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: git@vger.kernel.org, "Stephen R. van den Berg" <srb@cuci.nl>
Subject: Re: [updated2 PATCH] git-svn: Same default as cvsimport when using --use-log-author
Date: Wed, 30 Apr 2008 20:47:32 -0700	[thread overview]
Message-ID: <20080501034732.GA29803@untitled> (raw)
In-Reply-To: <20080429212032.8983.28194.stgit@aristoteles.cuci.nl>

"Stephen R. van den Berg" <srb@cuci.nl> wrote:
> When using git-cvsimport, the author is inferred from the cvs commit,
> e.g. cvs commit logname is foobaruser, then the author field in git
> results in:
> 
> Author: foobaruser <foobaruser>
> 
> Which is not perfect, but perfectly acceptable given the circumstances.
> 
> The default git-svn import however, results in:
> 
> Author: foobaruser <foobaruser@acf43c95-373e-0410-b603-e72c3f656dc1>
> 
> When using mixes of imports, from CVS and SVN into the same git
> repository, you'd like to harmonise the imports to the format cvsimport
> uses.
> git-svn supports an experimental option --use-log-author which currently
> results in the same logentry as without that option when no From: or
> Signed-off-by: is found in the logentry ($email currently ends up empty,
> and hence is generated again).
> 
> This patches harmonises the result with cvsimport, and makes
> git-svn --use-log-author produce:
> 
> Author: foobaruser <foobaruser>
 
> Signed-off-by: Stephen R. van den Berg <srb@cuci.nl>

Thanks Stephen,

Acked-by: Eric Wong <normalperson@yhbt.net>

> ---
> 
>  git-svn.perl |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> 
> diff --git a/git-svn.perl b/git-svn.perl
> index b151049..67726c1 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -2426,13 +2426,15 @@ sub make_log_entry {
>  			$name_field = $1;
>  		}
>  		if (!defined $name_field) {
> -			#
> +			if (!defined $email) {
> +				$email = $name;
> +			}
>  		} elsif ($name_field =~ /(.*?)\s+<(.*)>/) {
>  			($name, $email) = ($1, $2);
>  		} 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) {
> 
> 
> --

  reply	other threads:[~2008-05-01  3:48 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
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 [this message]
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=20080501034732.GA29803@untitled \
    --to=normalperson@yhbt.net \
    --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).