git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [updated2 PATCH] git-svn: Same default as cvsimport when using --use-log-author

From
EWEric Wong <normalperson@yhbt.net>
Date
May 1, 2008, 03:47 UTC
Message-ID
<20080501034732.GA29803@untitled>
In-Reply-To
<20080429212032.8983.28194.stgit@aristoteles.cuci.nl>
"Stephen R. van den Berg" <srb@cuci.nl> wrote:
Show 24 quoted lines
> 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>
Show 31 quoted lines
> ---
> 
>  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) {
> 
> 
> --
Previous: Stephen R. van den BergNext: Johannes Schindelin
Message 7 of 8 in “Same default as cvsimport when using --use-log-author”
  1. Same default as cvsimport when using --use-log-authorStephen R. van den Berg, Apr 27, 2008
  2. Junio C HamanoApr 27, 2008
  3. Eric WongApr 29, 2008
  4. Andy WhitcroftApr 29, 2008
  5. Stephen R. van den BergApr 29, 2008
  6. git-svn: Same default as cvsimport when using --use-log-authorStephen R. van den Berg, Apr 29, 2008
  7. Eric WongMay 1, 2008
  8. Johannes SchindelinApr 28, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.