threads / discuss / 14049

git svn --use-log-author misbehavior?

Subject: git svn --use-log-author misbehavior?

## tl;dr

6 messages between Jun 19, 2008 and Jun 20, 2008.

replies: 5people: 3as markdown or json

Mircea Bardac· Jun 19, 2008, 23:51 UTC · lore
Hi,
According to the documentation, this parameter (--use-log-author) should 
  use the author from the From/Signed-off-by line. Unfortunately, I 
found this to be working only on the first git svn clone. Later rebasing 
made the commits use the old username@uuid format.

I am assuming the option is not being preserved in the Git repository metadata and it is only used on cloning/init. Is this the intended behavior?

Many thanks.
-- 
Mircea
http://mircea.bardac.net
Fredrik Skolmli· Jun 20, 2008, 08:56 UTC · re: Mircea Bardac · lore

Re: git svn --use-log-author misbehavior?

On Fri, Jun 20, 2008 at 12:51:39AM +0100, Mircea Bardac wrote:
Show 10 quoted lines
> Hi,
> 
> According to the documentation, this parameter (--use-log-author) should 
>  use the author from the From/Signed-off-by line. Unfortunately, I 
> found this to be working only on the first git svn clone. Later rebasing 
> made the commits use the old username@uuid format.
> 
> I am assuming the option is not being preserved in the Git repository 
> metadata and it is only used on cloning/init. Is this the intended 
> behavior?
Doesn't look like it. When you're using --add-author-from on dcommit, git-svn
doesn't seem to know that it should look after "From:" in the commit, thus
not setting the author correctly. The following oneliner should solve the
case. Please let me know if it works as well for you as it did for me.
 
Signed-off-by: Fredrik Skolmli <fredrik@frsk.net>
---
 git-svn.perl |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index a54979d..8f77b91 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -432,6 +432,9 @@ sub cmd_dcommit {
 		     "without --no-rebase may be required."
 	}
 	while (1) {
+		if ($Git::SVN::_add_author_from) {
+			$Git::SVN::_use_log_author = 1;
+		}
 		my $d = shift @$linear_refs or last;
 		unless (defined $last_rev) {
 			(undef, $last_rev, undef) = cmt_metadata("$d~1");
-- 
1.5.6.6.gd3e97

-- 
Regards,
Fredrik Skolmli
Mircea Bardac· Jun 20, 2008, 10:13 UTC · re: Fredrik Skolmli · lore

Re: git svn --use-log-author misbehavior?

Fredrik Skolmli wrote:
Show 16 quoted lines
> On Fri, Jun 20, 2008 at 12:51:39AM +0100, Mircea Bardac wrote:
>> Hi,
>>
>> According to the documentation, this parameter (--use-log-author) should 
>>  use the author from the From/Signed-off-by line. Unfortunately, I 
>> found this to be working only on the first git svn clone. Later rebasing 
>> made the commits use the old username@uuid format.
>>
>> I am assuming the option is not being preserved in the Git repository 
>> metadata and it is only used on cloning/init. Is this the intended 
>> behavior?
> 
> Doesn't look like it. When you're using --add-author-from on dcommit, git-svn
> doesn't seem to know that it should look after "From:" in the commit, thus
> not setting the author correctly. The following oneliner should solve the
> case. Please let me know if it works as well for you as it did for me.
I haven't tested this yet but I have a feeling this is not my case, or I 
might not be fully understanding the implications of "--add-author-from" 
on the functionality of "--use-log-author". Technically, they should be 
independent and the options should not depend on each other:
* --use-log-author only applies to getting info from the commits
* --add-author-from only applies to putting info in the commits
 From the documentation, these 2 options can only be used with git svn 
init/clone so they should somehow be saved for future use. Maybe this 
doesn't happen.

My Git commits (not dcommits) already have "Signed-off-by:" at the end, added with "git commit -s". When I do a "git svn dcommit" they get pushed to SVN and the entire commit is rewritten. I have --add-author-from added on git clone, but nothing else is being added to the commit except the git-svn-id - from my point of view, according to the documentation, this is the correct behavior (since there already is a Signed-off-by line)

The problem is that, after the dcommit, when *viewing* the latest commits in the git-svn repository, even though they have "Signed-off-by:" in them, I see them not respecting the --use-log-author option, showing up as username@uuid. What I assume is that, after a dcommit (and everything being done on dcommit) the --use-log-author option is ignored.

Looking over the code, I see that make_log_entry (which is responsible for getting the correct format for the user/e-mail out of the commit message) is only being called in do_fetch and find_parent_branch. I am not sure if these are somehow called by cmd_dcommit.

Many thanks.

-- Mircea http://mircea.bardac.net

Stephen R. van den Berg· Jun 20, 2008, 10:48 UTC · re: Mircea Bardac · lore

Re: git svn --use-log-author misbehavior?

Mircea Bardac wrote:
Show 6 quoted lines
>I haven't tested this yet but I have a feeling this is not my case, or I 
>might not be fully understanding the implications of "--add-author-from" 
>on the functionality of "--use-log-author". Technically, they should be 
>independent and the options should not depend on each other:
>* --use-log-author only applies to getting info from the commits
>* --add-author-from only applies to putting info in the commits
They are independent.
>From the documentation, these 2 options can only be used with git svn 
>init/clone so they should somehow be saved for future use. Maybe this 
>doesn't happen.

At least --use-log-author can be used on git svn fetch (and possibly other subcommands) as well. And no, it currently is not being saved.

-- 
Sincerely,
           Stephen R. van den Berg.

Confidence is that feeling you have before you understand the situation.
Fredrik Skolmli· Jun 20, 2008, 10:57 UTC · re: Mircea Bardac · lore

Re: git svn --use-log-author misbehavior?

On Fri, Jun 20, 2008 at 11:13:17AM +0100, Mircea Bardac wrote:
Show 18 quoted lines
> I haven't tested this yet but I have a feeling this is not my case, or I 
> might not be fully understanding the implications of "--add-author-from" 
> on the functionality of "--use-log-author". Technically, they should be 
> independent and the options should not depend on each other:
> * --use-log-author only applies to getting info from the commits
> * --add-author-from only applies to putting info in the commits
> 
> From the documentation, these 2 options can only be used with git svn 
> init/clone so they should somehow be saved for future use. Maybe this 
> doesn't happen.
> 
> My Git commits (not dcommits) already have "Signed-off-by:" at the end, 
> added with "git commit -s". When I do a "git svn dcommit" they get 
> pushed to SVN and the entire commit is rewritten. I have 
> --add-author-from added on git clone, but nothing else is being added to 
> the commit except the git-svn-id - from my point of view, according to 
> the documentation, this is the correct behavior (since there already is 
> a Signed-off-by line)
 
Did you mean "git svn clone" here, not "git clone"? And if --use-log-author
is to be used to get retrieve info from the commits, it should be used
instead of --add-author-from when doing a clone. (Which as far as I can see
behaves correctly.)

However, looks like I might have misunderstood your problem, and possibly found a bug in the process. I'll look closer into it. :-)

-- 
Regards,
Fredrik Skolmli
Mircea Bardac· Jun 20, 2008, 12:04 UTC · re: Fredrik Skolmli · lore

Re: git svn --use-log-author misbehavior?

Fredrik Skolmli wrote:
Show 10 quoted lines
> On Fri, Jun 20, 2008 at 11:13:17AM +0100, Mircea Bardac wrote:
>> My Git commits (not dcommits) already have "Signed-off-by:" at the end, 
>> added with "git commit -s". When I do a "git svn dcommit" they get 
>> pushed to SVN and the entire commit is rewritten. I have 
>> --add-author-from added on git clone, but nothing else is being added to 
>> the commit except the git-svn-id - from my point of view, according to 
>> the documentation, this is the correct behavior (since there already is 
>> a Signed-off-by line)
>  
> Did you mean "git svn clone" here, not "git clone"?
Yes, I meant "git svn clone".
> And if --use-log-author
> is to be used to get retrieve info from the commits, it should be used
> instead of --add-author-from when doing a clone. (Which as far as I can see
> behaves correctly.)

That is right. I am using them like this, but according to Stephen's reply the --use-log-author option is not being saved. I assumed they were saved as an option of the git svn clone so that they would affect all future dcommits.

-- Mircea http://mircea.bardac.net

← back to recent threads