]> git.ipfire.org Git - thirdparty/git.git/commit - git-svn.perl
git-svn: parse authors file more leniently
authorMichael J Gruber <git@drmicha.warpmail.net>
Thu, 10 Sep 2015 12:32:13 +0000 (14:32 +0200)
committerEric Wong <normalperson@yhbt.net>
Thu, 10 Sep 2015 17:59:38 +0000 (17:59 +0000)
commitf7c6de0ea1bd5722a1181c6279676c6831b38a34
treeebe3ce2622af7758edd4d3bfab1532b87795b840
parent7a2c4af7a82eebf2ed0e60a2b36c31e70c619264
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>
git-svn.perl