From: Andy Whitcroft <apw@shadowen.org>
To: Eric Wong <normalperson@yhbt.net>
Cc: Junio C Hamano <gitster@pobox.com>,
"Stephen R. van den Berg" <srb@cuci.nl>,
git@vger.kernel.org
Subject: Re: [updated PATCH] Same default as cvsimport when using --use-log-author
Date: Tue, 29 Apr 2008 10:52:24 +0100 [thread overview]
Message-ID: <20080429095213.GY5401@shadowen.org> (raw)
In-Reply-To: <20080429061823.GE24171@muzzle>
On Mon, Apr 28, 2008 at 11:18:23PM -0700, 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...
> >
> > > 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.
My motivation was that we had picked up a field which is supposed to be
in RFC822 From: format, ie Name <email>, and dispite trying pretty hard
we had not been able to find something that looked like an email to put
in the email field of the git author et al. So we didn't really know,
hence 'unknown'.
That said it is not at all clear that putting 'unknown' in this field to
avoid putting an invalid email in this field makes much sense as it of
itself is just as invalid. So I would probabally be just as happy with
your option here.
> $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
-apw
next prev parent reply other threads:[~2008-04-29 9:53 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
2008-04-29 9:52 ` Andy Whitcroft [this message]
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=20080429095213.GY5401@shadowen.org \
--to=apw@shadowen.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=normalperson@yhbt.net \
--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).