Re: [PATCH 2/3] git-svn: Add --add-author-from option.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Avery Pennarun" <apenwarr@xxxxxxxxx> writes:

> On 4/16/08, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> apenwarr@xxxxxxxxx writes:
>>  > This adds a From: line (based on the commit's author information) when
>>  > sending to svn.  It doesn't add if a From: or Signed-off-by: header already
>>  > exists for that commit.
>>
>> I admit that I do not use git-svn, but I am confused.  Where are you
>>  adding that "From:"?  You grab a commit log message out of git (which does
>>  not have such "From:", add such a line at the beginning of the commit
>>  message using the authorship information and send the resulting commit log
>>  message to svn?  Why?
>
> When git-svn copies a commit from git to svn, svn eats the authorship
> information; it always sets the svn author field to the username of
> the person logged into the svn server.

Let me rephrase that to see if I understand what you are saying.  If you
look at the "svn log" output (not "git svn log"), you see that the result
of "git-svn dcommit" does not record the same 'author' as git side does;
instead it uses whoever ran git-svn to propagate the commit to the SVN
side.

> With the (existing) --use-log-author option, git-svn will pull From:
> and Signed-off-by: lines from svn's log entries when pulling back into
> git, which helps with this problem.  However, it only works with
> commits that have a Signed-off-by: or From: already included.

Ah, that is because the way the commit is propagated is (1) you read git
commit; (2) you make a corresponding SVN commit using the log message you
read in step (1); (3) you read that SVN commit back, and create a _new_
git commit and replace what you read in step (1).  The new git commit is
marked with the authorship information you obtain from the SVN side,
unless the commit log message you read back from the SVN side has these
special markers (and you are using the --use-log-author option).

Is that what is happening?

And your solution is to add these markers in step (2).

If that is the case, I understand how and why this would work around the
issue.  A possible downside with this approach is that such a commit in
SVN (from SVN person's point of view) has extra information that is
unusual in the log message part (namely "From: ").

It makes me wonder if there is a better way.

For example, CVS honors LOGNAME to allow you to "lie" who the author of a
change was, which is the behaviour inherited from RCS.  I have to wonder
if SVN has a similar mechanism to tell it "Excuse me, but I am just a
secretary recording changes for my boss."

But perhaps there isn't and that was why you did it this way (and that is
why --use-log-author was invented 5 months ago).  And the issue that the
commit on the SVN side has unusual (again, from SVN person's point of
view) information not in the original commit on the git side might not be
so grave, so it probably is Ok.

Eric? Sam?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux