threads / discuss / 13128

git-svn dcommit always uses my own name

Subject: git-svn dcommit always uses my own name

## tl;dr

3 messages between Apr 15, 2008 and Apr 15, 2008.

replies: 2people: 2as markdown or json

Avery Pennarun· Apr 15, 2008, 21:25 UTC · lore
Hi all,
Here's the workflow I'm using:
- I check out the central svn repository into a shared git repo using git-svn
- Each team member clones the shared repo, works in it, etc.
- I integrate their changes using git-pull, merge, rebase, etc,
forming a linearized history suitable for git-svn
- I run git-svn dcommit.

However, when I do this, all the commits to svn end up having *my* userid attached, rather than the userid of the git user. If I do "git log" before "git-svn dcommit", it shows all the right authors, but this information is lost when I dcommit.

Is there a way to not lose this information?
Thanks,
Avery
Richard Quirk· Apr 15, 2008, 22:08 UTC · re: Avery Pennarun · lore

Re: git-svn dcommit always uses my own name

On Tue, Apr 15, 2008 at 11:25 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
Show 7 quoted lines
>  However, when I do this, all the commits to svn end up having *my*
>  userid attached, rather than the userid of the git user.  If I do "git
>  log" before "git-svn dcommit", it shows all the right authors, but
>  this information is lost when I dcommit.
>
>  Is there a way to not lose this information?
>

Subversion only remembers the user that made the commit; there's no way to tell it that someone else wrote the patch and that you just committed it. However, examining git-svn, there seems to be an undocumented option. You can do this:

git svn dcommit --use-log-author

That uses the Signed-off-by: field in the commit message to extract the author information. Of course it won't rescue the author field on old commits, and you have to have Signed-off-by on any new ones to gain any benefit.

regards, Richard

Avery Pennarun· Apr 15, 2008, 22:35 UTC · re: Richard Quirk · lore

Re: git-svn dcommit always uses my own name

On 4/15/08, Richard Quirk <richard.quirk@gmail.com> wrote:
Show 11 quoted lines
> Subversion only remembers the user that made the commit; there's no
>  way to tell it that someone else wrote the patch and that you just
>  committed it. However, examining git-svn, there seems to be an
>  undocumented option. You can do this:
>
>  git svn dcommit --use-log-author
>
>  That uses the Signed-off-by: field in the commit message to extract
>  the author information. Of course it won't rescue the author field on
>  old commits, and you have to have Signed-off-by on any new ones to
>  gain any benefit.

Hmm, it looks like --use-log-author really affects git-svn fetch, not commit: in other words, it pulls the signed-off-by information from the svn repo when importing the commits back into git.

This is actually the clue I needed, which I think is: use signed-off-by lines in the first place, because that will solve my problem of tracking who wrote each patch :)

Have fun,
Avery

← back to recent threads