git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Stephen R. van den Berg" <srb@cuci.nl>,
	git@vger.kernel.org, Andy Whitcroft <apw@shadowen.org>
Subject: Re: [updated PATCH] Same default as cvsimport when using --use-log-author
Date: Mon, 28 Apr 2008 23:18:23 -0700	[thread overview]
Message-ID: <20080429061823.GE24171@muzzle> (raw)
In-Reply-To: <7vbq3vf2k4.fsf@gitster.siamese.dyndns.org>

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...
> 
> > This patches harmonises the result with cvsimport, and makes
> > git-svn --use-log-author produce:
> >
> > Author: foobaruser <foobaruser>
> > ...
> > diff --git a/git-svn.perl b/git-svn.perl
> > index b151049..846e739 100755
> > --- a/git-svn.perl
> > +++ b/git-svn.perl
> > @@ -2434,6 +2434,9 @@ sub make_log_entry {
> >  		} else {
> >  			($name, $email) = ($name_field, 'unknown');
> >  		}
> 
> ... this 'unknown' we see here?
> 
> > +	        if (!defined $email) {
> > +		    $email = $name;
> > +	        }
> >  	}
> 
> 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...
> 
> 	} else {
> 		$name = $name_field;
> 	}
>         if (!defined $email) {
> 	    $email = $name;
>         }
> 

I don't think Stephen's patch ever gets triggered, either.

This section of code was done by Andy, so I can't tell his motivations
for using 'unknown' the way he did.

$email does appear to get set correctly for the first two elsifs cases
here in the existing code:

		if (!defined $name_field) {
			#
		} elsif ($name_field =~ /(.*?)\s+<(.*)>/) {
			($name, $email) = ($1, $2);
		} elsif ($name_field =~ /(.*)@/) {
			($name, $email) = ($1, $name_field);
		} else {
			($name, $email) = ($name_field, $name_field);

So I propose the following one-line change instead of Stephen's:

diff --git a/git-svn.perl b/git-svn.perl
index b151049..301a5b4 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2432,7 +2432,7 @@ sub make_log_entry {
 		} elsif ($name_field =~ /(.*)@/) {
 			($name, $email) = ($1, $name_field);
 		} else {
-			($name, $email) = ($name_field, 'unknown');
+			($name, $email) = ($name_field, $name_field);
 		}
 	}
 	if (defined $headrev && $self->use_svm_props) {

-- 
Eric Wong

  reply	other threads:[~2008-04-29  6:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-27 17:32 [updated PATCH] Same default as cvsimport when using --use-log-author Stephen R. van den Berg
2008-04-27 20:47 ` Junio C Hamano
2008-04-29  6:18   ` Eric Wong [this message]
2008-04-29  9:52     ` Andy Whitcroft
2008-04-29 21:13     ` Stephen R. van den Berg
2008-04-29 21:20       ` [updated2 PATCH] git-svn: " Stephen R. van den Berg
2008-05-01  3:47         ` Eric Wong
2008-04-28 10:15 ` [updated PATCH] " Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080429061823.GE24171@muzzle \
    --to=normalperson@yhbt.net \
    --cc=apw@shadowen.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=srb@cuci.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).