Re: [updated PATCH] Same default as cvsimport when using --use-log-author
- From
Stephen R. van den Berg <srb@cuci.nl>
- Date
- Apr 29, 2008, 21:13 UTC
- Message-ID
- <20080429211356.GA6825@cuci.nl>
- In-Reply-To
- <20080429061823.GE24171@muzzle>
Eric Wong wrote:
>Junio C Hamano <gitster@pobox.com> wrote: >> "Stephen R. van den Berg" <srb@cuci.nl> writes: >> > git-svn supports an experimental option --use-log-author which currently >> > results in:
>> > Author: foobaruser <unknown>
>> I have a question about this. Is the "<unknown> coming from...
I have to correct myself here. What happens is that if in the commit message there is no From: or Signed-off-by: to be found to parse, that results in an empty $name_field, and causes $email to stay undefined, which eventually results in the same silly generated UUID-domain I'm trying to get rid of.
So it's not triggering the 'unknown' above.
Show 5 quoted lines
>> I would think not -- if that is the case, the codepath you added as a fix >> would not trigger. Which means in some other cases, the 'unknown' we see >> above in the context also still happens. Is it a good thing? Maybe we >> would also want to make it consistently do "somebody <somebody>" instead, >> by doing...
>I don't think Stephen's patch ever gets triggered, either.
Well, it is triggered, but rather because $name_field is empty, and consequently $email is never set.
>$email does appear to get set correctly for the first two elsifs cases >here in the existing code:
>So I propose the following one-line change instead of Stephen's:
>diff --git a/git-svn.perl b/git-svn.perl
>@@ -2432,7 +2432,7 @@ sub make_log_entry {
>- ($name, $email) = ($name_field, 'unknown');
>+ ($name, $email) = ($name_field, $name_field);That is a good change (IMO), but I still need my patch (or something similar) to cover the undefined $name_field case. Proposed new patch follows.
--
Sincerely, srb@cuci.nl
Stephen R. van den Berg.
"There's a lot to be said for not saying a lot."