Skip to content

Commit f7c6de0

Browse files
Michael J GruberEric Wong
authored andcommitted
git-svn: parse authors file more leniently
Currently, git-svn parses an authors file using the perl regex /^(.+?|\(no author\))\s*=\s*(.+?)\s*<(.+)>\s*$/ in order to extract svn user name, real name and e-mail. This does not match an empty e-mail field like "<>". On the other hand, the output of an authors-prog is parsed with the perl regex /^\s*(.+?)\s*<(.*)>\s*$/ in order to extract real name and e-mail. So, specifying a trivial file grep such as grep "$1" /tmp/authors | head -n 1 | cut -d'=' -f2 | cut -c'2-' as the authors prog gives different results compared to specifying /tmp/authors as the authors file directly. Instead, make git svn uses the perl regex /^(.+?|\(no author\))\s*=\s*(.+?)\s*<(.*)>\s*$/ for parsing the authors file so that the same (slightly more lenient) regex is used in both cases. Reported-by: Till Schäfer <till2.schaefer@tu-dortmund.de> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Eric Wong <normalperson@yhbt.net>
1 parent 7a2c4af commit f7c6de0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

git-svn.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1924,7 +1924,7 @@ sub load_authors {
19241924
my $log = $cmd eq 'log';
19251925
while (<$authors>) {
19261926
chomp;
1927-
next unless /^(.+?|\(no author\))\s*=\s*(.+?)\s*<(.+)>\s*$/;
1927+
next unless /^(.+?|\(no author\))\s*=\s*(.+?)\s*<(.*)>\s*$/;
19281928
my ($user, $name, $email) = ($1, $2, $3);
19291929
if ($log) {
19301930
$Git::SVN::Log::rusers{"$name <$email>"} = $user;

0 commit comments

Comments
 (0)