Skip to content

Commit abfa533

Browse files
BuGlessRBgitster
authored andcommitted
git-svn: Same default as cvsimport when using --use-log-author
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 <[email protected]> Acked-by: Eric Wong <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e4b9c36 commit abfa533

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

git-svn.perl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2428,13 +2428,15 @@ sub make_log_entry {
24282428
$name_field = $1;
24292429
}
24302430
if (!defined $name_field) {
2431-
#
2431+
if (!defined $email) {
2432+
$email = $name;
2433+
}
24322434
} elsif ($name_field =~ /(.*?)\s+<(.*)>/) {
24332435
($name, $email) = ($1, $2);
24342436
} elsif ($name_field =~ /(.*)@/) {
24352437
($name, $email) = ($1, $name_field);
24362438
} else {
2437-
($name, $email) = ($name_field, 'unknown');
2439+
($name, $email) = ($name_field, $name_field);
24382440
}
24392441
}
24402442
if (defined $headrev && $self->use_svm_props) {

0 commit comments

Comments
 (0)