{"thread":{"id":"48024","subject":"[PATCH v2 0/2] git-svn: --author-prog improvements","startedAt":"2018-03-11T13:59:17Z","lastAt":"2018-04-11T23:19:06Z","messageCount":13,"participants":["Andreas Heiduk","Eric Sunshine","Eric Wong","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"341418","messageId":"20180311135835.9775-1-asheiduk@gmail.com","threadId":"48024","inReplyTo":"20180304112237.19254-1-asheiduk@gmail.co","subject":"[PATCH v2 0/2] git-svn: --author-prog improvements","fromName":"Andreas Heiduk","fromEmail":"asheiduk@gmail.com","sentAt":"2018-03-11T13:58:33Z","receivedAt":"2018-03-11T13:59:17Z","isPatch":true,"sender":{"key":"asheiduk@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9371344?v=4"},"body":"The first patch has been queued by Eric Wong but by Junio Hamano, so\nI'm not sure what's the expected procedure. I#M posting it again just\nin case.\n\nThe second patch has grown up with some documentation and some tests.\n\nAndreas Heiduk (2):\n  git-svn: search --authors-prog in PATH too\n  git-svn: allow empty email-address in authors-prog and authors-file\n\n Documentation/git-svn.txt       | 13 ++++++++++---\n git-svn.perl                    |  3 ++-\n perl/Git/SVN.pm                 | 13 ++++++-------\n t/t9130-git-svn-authors-file.sh | 14 ++++++++++++++\n t/t9138-git-svn-authors-prog.sh | 25 ++++++++++++++++++++++++-\n 5 files changed, 56 insertions(+), 12 deletions(-)\n\n-- \n2.16.2\n\n"},{"id":"341419","messageId":"20180311135835.9775-2-asheiduk@gmail.com","threadId":"48024","inReplyTo":"20180311135835.9775-1-asheiduk@gmail.com","subject":"[PATCH v2 1/2] git-svn: search --authors-prog in PATH too","fromName":"Andreas Heiduk","fromEmail":"asheiduk@gmail.com","sentAt":"2018-03-11T13:58:34Z","receivedAt":"2018-03-11T13:59:22Z","isPatch":true,"sender":{"key":"asheiduk@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9371344?v=4"},"body":"In 36db1eddf9 (\"git-svn: add --authors-prog option\", 2009-05-14) the path\nto authors-prog was made absolute because git-svn changes the current\ndirectory in some situations. This makes sense if the program is part of\nthe repository but prevents searching via $PATH.\n\nThe old behaviour is still retained, but if the file does not exists, then\nauthors-prog is searched for in $PATH as any other command.\n\nSigned-off-by: Andreas Heiduk <asheiduk@gmail.com>\nSigned-off-by: Eric Wong <e@80x24.org>\n---\n Documentation/git-svn.txt | 5 +++++\n git-svn.perl              | 3 ++-\n 2 files changed, 7 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 636e09048e..b858374649 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -657,6 +657,11 @@ config key: svn.authorsfile\n \texpected to return a single line of the form \"Name <email>\",\n \twhich will be treated as if included in the authors file.\n +\n+Due to historical reasons a relative 'filename' is first searched\n+relative to the current directory for 'init' and 'clone' and relative\n+to the root of the working tree for 'fetch'. If 'filename' is\n+not found, it is searched like any other command in '$PATH'.\n++\n [verse]\n config key: svn.authorsProg\n \ndiff --git a/git-svn.perl b/git-svn.perl\nindex a6b6c3e40c..050f2a36f4 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -374,7 +374,8 @@ version() if $_version;\n usage(1) unless defined $cmd;\n load_authors() if $_authors;\n if (defined $_authors_prog) {\n-\t$_authors_prog = \"'\" . File::Spec->rel2abs($_authors_prog) . \"'\";\n+\tmy $abs_file = File::Spec->rel2abs($_authors_prog);\n+\t$_authors_prog = \"'\" . $abs_file . \"'\" if -x $abs_file;\n }\n \n unless ($cmd =~ /^(?:clone|init|multi-init|commit-diff)$/) {\n-- \n2.16.2\n\n"},{"id":"341420","messageId":"20180311135835.9775-3-asheiduk@gmail.com","threadId":"48024","inReplyTo":"20180311135835.9775-1-asheiduk@gmail.com","subject":"[PATCH v2 2/2] git-svn: allow empty email-address in authors-prog and authors-file","fromName":"Andreas Heiduk","fromEmail":"asheiduk@gmail.com","sentAt":"2018-03-11T13:58:35Z","receivedAt":"2018-03-11T13:59:26Z","isPatch":true,"sender":{"key":"asheiduk@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9371344?v=4"},"body":"The email address in --authors-file and --authors-prog can be empty but\ngit-svn translated it into a syntethic email address in the form\n$USERNAME@$REPO_UUID. Now git-svn behaves like git-commit: If the email\nis explicitly set to the empty string, the commit does not contain\nan email address.\n\nSigned-off-by: Andreas Heiduk <asheiduk@gmail.com>\n---\n Documentation/git-svn.txt       |  8 +++++---\n perl/Git/SVN.pm                 | 13 ++++++-------\n t/t9130-git-svn-authors-file.sh | 14 ++++++++++++++\n t/t9138-git-svn-authors-prog.sh | 25 ++++++++++++++++++++++++-\n 4 files changed, 49 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex b858374649..d59379ee23 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -635,7 +635,8 @@ config key: svn.findcopiesharder\n \n -A<filename>::\n --authors-file=<filename>::\n-\tSyntax is compatible with the file used by 'git cvsimport':\n+\tSyntax is compatible with the file used by 'git cvsimport' but\n+\tan empty email address can be supplied with '<>':\n +\n ------------------------------------------------------------------------\n \tloginname = Joe User <user@example.com>\n@@ -654,8 +655,9 @@ config key: svn.authorsfile\n \tIf this option is specified, for each SVN committer name that\n \tdoes not exist in the authors file, the given file is executed\n \twith the committer name as the first argument.  The program is\n-\texpected to return a single line of the form \"Name <email>\",\n-\twhich will be treated as if included in the authors file.\n+\texpected to return a single line of the form \"Name <email>\" or\n+\t\"Name <>\", which will be treated as if included in the authors\n+\tfile.\n +\n Due to historical reasons a relative 'filename' is first searched\n relative to the current directory for 'init' and 'clone' and relative\ndiff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm\nindex bc4eed3d75..945ca4db2b 100644\n--- a/perl/Git/SVN.pm\n+++ b/perl/Git/SVN.pm\n@@ -1482,7 +1482,6 @@ sub call_authors_prog {\n \t}\n \tif ($author =~ /^\\s*(.+?)\\s*<(.*)>\\s*$/) {\n \t\tmy ($name, $email) = ($1, $2);\n-\t\t$email = undef if length $2 == 0;\n \t\treturn [$name, $email];\n \t} else {\n \t\tdie \"Author: $orig_author: $::_authors_prog returned \"\n@@ -2020,8 +2019,8 @@ sub make_log_entry {\n \t\tremove_username($full_url);\n \t\t$log_entry{metadata} = \"$full_url\\@$r $uuid\";\n \t\t$log_entry{svm_revision} = $r;\n-\t\t$email ||= \"$author\\@$uuid\";\n-\t\t$commit_email ||= \"$author\\@$uuid\";\n+\t\t$email = \"$author\\@$uuid\" unless defined $email;\n+\t\t$commit_email = \"$author\\@$uuid\" unless defined $commit_email;\n \t} elsif ($self->use_svnsync_props) {\n \t\tmy $full_url = canonicalize_url(\n \t\t\tadd_path_to_url( $self->svnsync->{url}, $self->path )\n@@ -2029,15 +2028,15 @@ sub make_log_entry {\n \t\tremove_username($full_url);\n \t\tmy $uuid = $self->svnsync->{uuid};\n \t\t$log_entry{metadata} = \"$full_url\\@$rev $uuid\";\n-\t\t$email ||= \"$author\\@$uuid\";\n-\t\t$commit_email ||= \"$author\\@$uuid\";\n+\t\t$email = \"$author\\@$uuid\" unless defined $email;\n+\t\t$commit_email = \"$author\\@$uuid\" unless defined $commit_email;\n \t} else {\n \t\tmy $url = $self->metadata_url;\n \t\tremove_username($url);\n \t\tmy $uuid = $self->rewrite_uuid || $self->ra->get_uuid;\n \t\t$log_entry{metadata} = \"$url\\@$rev \" . $uuid;\n-\t\t$email ||= \"$author\\@\" . $uuid;\n-\t\t$commit_email ||= \"$author\\@\" . $uuid;\n+\t\t$email = \"$author\\@$uuid\" unless defined $email;\n+\t\t$commit_email = \"$author\\@$uuid\" unless defined $commit_email;\n \t}\n \t$log_entry{name} = $name;\n \t$log_entry{email} = $email;\ndiff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh\nindex 41264818cc..6af6daf461 100755\n--- a/t/t9130-git-svn-authors-file.sh\n+++ b/t/t9130-git-svn-authors-file.sh\n@@ -108,6 +108,20 @@ test_expect_success !MINGW 'fresh clone with svn.authors-file in config' '\n \t)\n '\n \n+cat >> svn-authors <<EOF\n+ff = FFFFFFF FFFFFFF <>\n+EOF\n+\n+test_expect_success 'authors-file imported user without email' '\n+\tsvn_cmd mkdir -m aa/branches/ff --username ff \"$svnrepo/aa/branches/ff\" &&\n+\t(\n+\t\tcd aa-work &&\n+\t\tgit svn fetch --authors-file=../svn-authors &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/origin/ff | \\\n+\t\t  grep \"^author FFFFFFF FFFFFFF <> \"\n+\t)\n+\t'\n+\n test_debug 'GIT_DIR=gitconfig.clone/.git git log'\n \n test_done\ndiff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh\nindex 7d7e9d46bc..0cec56128f 100755\n--- a/t/t9138-git-svn-authors-prog.sh\n+++ b/t/t9138-git-svn-authors-prog.sh\n@@ -9,7 +9,9 @@ test_description='git svn authors prog tests'\n \n write_script svn-authors-prog \"$PERL_PATH\" <<-\\EOF\n \t$_ = shift;\n-\tif (s/-sub$//)  {\n+\tif (s/-hermit//) {\n+\t\tprint \"$_ <>\\n\";\n+\t} elsif (s/-sub$//)  {\n \t\tprint \"$_ <$_\\@sub.example.com>\\n\";\n \t} else {\n \t\tprint \"$_ <$_\\@example.com>\\n\";\n@@ -68,6 +70,27 @@ test_expect_success 'authors-file overrode authors-prog' '\n git --git-dir=x/.git config --unset svn.authorsfile\n git --git-dir=x/.git config --unset svn.authorsprog\n \n+test_expect_success 'authors-prog imported user without email' '\n+\tsvn mkdir -m gg --username gg-hermit \"$svnrepo\"/gg &&\n+\t(\n+\t\tcd x &&\n+\t\tgit svn fetch --authors-prog=../svn-authors-prog &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n+\t\t  grep \"^author gg <> \"\n+\t)\n+'\n+\n+test_expect_success 'imported without authors-prog and authors-file' '\n+\tsvn mkdir -m hh --username hh \"$svnrepo\"/hh &&\n+\t(\n+\t\tuuid=$(svn info --show-item=repos-uuid \"$svnrepo\") &&\n+\t\tcd x &&\n+\t\tgit svn fetch &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n+\t\t  grep \"^author hh <hh@$uuid> \"\n+\t)\n+'\n+\n test_expect_success 'authors-prog handled special characters in username' '\n \tsvn mkdir -m bad --username \"xyz; touch evil\" \"$svnrepo\"/bad &&\n \t(\n-- \n2.16.2\n\n"},{"id":"342113","messageId":"bf90b92a-d982-df89-7b01-b4a233181cb2@gmail.com","threadId":"48024","inReplyTo":"20180311135835.9775-1-asheiduk@gmail.com","subject":"Re: [PATCH v2 0/2] git-svn: --author-prog improvements","fromName":"Andreas Heiduk","fromEmail":"asheiduk@gmail.com","sentAt":"2018-03-18T21:19:43Z","receivedAt":"2018-03-18T21:19:51Z","isPatch":true,"sender":{"key":"asheiduk@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9371344?v=4"},"body":"No comments on this one?\n"},{"id":"342114","messageId":"CAPig+cQ1Si-AvazF_1Kf4yX9+eGD9tGUdvP7npJ3uYxy1pLy2w@mail.gmail.com","threadId":"48024","inReplyTo":"bf90b92a-d982-df89-7b01-b4a233181cb2@gmail.com","subject":"Re: [PATCH v2 0/2] git-svn: --author-prog improvements","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-03-18T21:31:24Z","receivedAt":"2018-03-18T21:31:30Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Mar 18, 2018 at 5:19 PM, Andreas Heiduk <asheiduk@gmail.com> wrote:\n> No comments on this one?\n\nI can't speak for Eric W., but my impression was that v2 did not\naddress his concern that patch 2/2's unconditional change of behavior\nwas unacceptable[1]. He didn't say so explicitly, but perhaps the\nimplication was that he might be more open to the behavior change\nbeing an opt-in.\n\n[1]: https://public-inbox.org/git/20180305202017.GA26533@whir/\n"},{"id":"342120","messageId":"20180318230425.GB25017@80x24.org","threadId":"48024","inReplyTo":"20180311135835.9775-3-asheiduk@gmail.com","subject":"Re: [PATCH v2 2/2] git-svn: allow empty email-address in authors-prog and authors-file","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2018-03-18T23:04:25Z","receivedAt":"2018-03-18T23:04:30Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Andreas Heiduk <asheiduk@gmail.com> wrote:\n> The email address in --authors-file and --authors-prog can be empty but\n> git-svn translated it into a syntethic email address in the form\n> $USERNAME@$REPO_UUID. Now git-svn behaves like git-commit: If the email\n> is explicitly set to the empty string, the commit does not contain\n> an email address.\n\nWhat is missing is WHY \"<>\" is preferable to \"<$USERNAME@$REPO_UUID>\".\n\n$USERNAME is good anyways since projects/organizations tie their\nSVN usernames to email usernames via LDAP, making it easy to\ninfer their email address from $USERNAME.  The latter can also\nbe used to disambiguate authors if they happen to have the same\nreal name.\n\n\"<>\" is completely meaningless.\n"},{"id":"342262","messageId":"b3fce9b7-9fc7-c5a6-eaa5-a5c12ef7d492@gmail.com","threadId":"48024","inReplyTo":"20180318230425.GB25017@80x24.org","subject":"Re: [PATCH v2 2/2] git-svn: allow empty email-address in authors-prog and authors-file","fromName":"Andreas Heiduk","fromEmail":"asheiduk@gmail.com","sentAt":"2018-03-19T22:48:15Z","receivedAt":"2018-03-19T22:48:26Z","isPatch":true,"sender":{"key":"asheiduk@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9371344?v=4"},"body":"Am 19.03.2018 um 00:04 schrieb Eric Wong:\n> Andreas Heiduk <asheiduk@gmail.com> wrote:\n>> The email address in --authors-file and --authors-prog can be empty but\n>> git-svn translated it into a syntethic email address in the form\n>> $USERNAME@$REPO_UUID. Now git-svn behaves like git-commit: If the email\n>> is explicitly set to the empty string, the commit does not contain\n>> an email address.\n> \n> What is missing is WHY \"<>\" is preferable to \"<$USERNAME@$REPO_UUID>\".\n>\n> $USERNAME is good anyways since projects/organizations tie their\n> SVN usernames to email usernames via LDAP, making it easy to\n> infer their email address from $USERNAME.  The latter can also\n> be used to disambiguate authors if they happen to have the same\n> real name.\n\nThat's still available and it's even still the default.\n\nBut: If the user of git-svn takes the burden of writing an authors\nscript or maintaining an authors file then he should have full control\nover the result as long as git can handle the output reasonably.\nCurrently that's the case for git but not for git-svn.\n\nGit can handle empty emails quite nicely:\n\n    > git -c user.email= commit --allow-empty -m \"foo\"\n    > git show --format=raw HEAD | egrep \"author|committer\"\n    author jondoe <> 1521495217 +0100\n    committer jondoe <> 1521495217 +0100\n\nDoing the same with current git-svn requires a filter-branch followed\nby `rm -r .git/svn/`  followed by `git svn fetch` to recreate the\nrev_map files. That would be feasible for a one-time conversion but\nnot in a situation where SVN is live and the master repository.\n\n>\n> \"<>\" is completely meaningless.\n>\n\nNot quite. The \"<>\" is not the only information - there is still the\nmandatory \"name\" part. So the commit id\n\n    jondoe <>\n\njust means: \"There is intentionally no email address.\" For an\ninternal, ephemeral repository that can be OK. It has the advantage,\nthat no automatic system (Jira, Jenkins, ...) will try to send emails to \n\n    jondoe <jondoe@6aafaa21e0fb4338a68ab372a049893d>\n\nAdditionally the log output isn't cluttered with irrelevant stuff. :-)\n\nAnd last but not least we don't have to hunt down names long gone by and\nalready deleted in LDAP. In that case the UUID doesn't help either.\n\n\nFurther steps: Eric Sunshine mentioned [1] that you might have concerns about\nthe change of behavior per se. For me the patch is not so much a new feature but\na bugfix bringing git-svn in sync with git itself. Adding an option parameter \nto enable the new behavior seems strange to me. But there might be other ways\nto achieve the same effect:\n\n- changing the output format of the file and prog: empty emails could be \n  marked by a syntax which is invalid so far.\n\n- OR (if some change of behaviour is acceptable) the script could evaluate\n  a new environment variable like GIT_SVN_UUID to compose the \n  `<$user@$uuid>` part itself.\n\n- OR just mention it in the relaese notes ;-)\n\n- OR [please insert ideas here]\n\n\n[1] https://public-inbox.org/git/CAPig+cQ1Si-AvazF_1Kf4yX9+eGD9tGUdvP7npJ3uYxy1pLy2w@mail.gmail.com/\n"},{"id":"342366","messageId":"20180320220743.GA17234@whir","threadId":"48024","inReplyTo":"b3fce9b7-9fc7-c5a6-eaa5-a5c12ef7d492@gmail.com","subject":"Re: [PATCH v2 2/2] git-svn: allow empty email-address in authors-prog and authors-file","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2018-03-20T22:07:43Z","receivedAt":"2018-03-20T22:07:49Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Andreas Heiduk <asheiduk@gmail.com> wrote:\n> Am 19.03.2018 um 00:04 schrieb Eric Wong:\n> > Andreas Heiduk <asheiduk@gmail.com> wrote:\n> >> The email address in --authors-file and --authors-prog can be empty but\n> >> git-svn translated it into a syntethic email address in the form\n> >> $USERNAME@$REPO_UUID. Now git-svn behaves like git-commit: If the email\n> >> is explicitly set to the empty string, the commit does not contain\n> >> an email address.\n> > \n> > What is missing is WHY \"<>\" is preferable to \"<$USERNAME@$REPO_UUID>\".\n> >\n> > $USERNAME is good anyways since projects/organizations tie their\n> > SVN usernames to email usernames via LDAP, making it easy to\n> > infer their email address from $USERNAME.  The latter can also\n> > be used to disambiguate authors if they happen to have the same\n> > real name.\n> \n> That's still available and it's even still the default.\n\nOK.\n\n> But: If the user of git-svn takes the burden of writing an authors\n> script or maintaining an authors file then he should have full control\n> over the result as long as git can handle the output reasonably.\n> Currently that's the case for git but not for git-svn.\n\nFair enough.\n\n>     jondoe <>\n> \n> just means: \"There is intentionally no email address.\" For an\n> internal, ephemeral repository that can be OK. It has the advantage,\n> that no automatic system (Jira, Jenkins, ...) will try to send emails to \n> \n>     jondoe <jondoe@6aafaa21e0fb4338a68ab372a049893d>\n\nOK, that's a good reason to allow \"<>\" and should be in the\ncommit message.\n\n> Further steps: Eric Sunshine mentioned [1] that you might have concerns about\n> the change of behavior per se. For me the patch is not so much a new feature but\n> a bugfix bringing git-svn in sync with git itself. Adding an option parameter \n> to enable the new behavior seems strange to me. But there might be other ways\n> to achieve the same effect:\n\nNew options are not desirable, either, as they increase\ntesting/maintenance overhead.  So I'm inclined to take your\npatch with only an updated commit message...\n\nNo rush, though; will wait another bit for others to comment and\nI expect to be preoccupied this week with other projects and\nweather problems on the forecast :<\n"},{"id":"342811","messageId":"20180324102046.8840-1-asheiduk@gmail.com","threadId":"48024","inReplyTo":"20180320220743.GA17234@whir","subject":"[PATCH v3] git-svn: allow empty email-address using authors-prog and authors-file","fromName":"Andreas Heiduk","fromEmail":"asheiduk@gmail.com","sentAt":"2018-03-24T10:20:46Z","receivedAt":"2018-03-24T10:22:15Z","isPatch":true,"sender":{"key":"asheiduk@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9371344?v=4"},"body":"The email address in --authors-file and --authors-prog can be empty but\ngit-svn translated it into a fictional email address in the form\n\n\tjondoe <jondoe@6aafaa21e0fb4338a68ab372a049893d>\n\ncontaining the SVN repository UUID. Now git-svn behaves like git-commit:\nIf the email is *explicitly* set to the empty string using '<>', the\ncommit does not contain an email address, only the name:\n\n\tjondoe <>\n\nAllowing to remove the email address *intentionally* prevents automatic\nsystems from sending emails to those fictional addresses and avoids\ncluttering the log output with unnecessary stuff.\n\nSigned-off-by: Andreas Heiduk <asheiduk@gmail.com>\n---\n Documentation/git-svn.txt       |  8 +++++---\n perl/Git/SVN.pm                 | 13 ++++++-------\n t/t9130-git-svn-authors-file.sh | 14 ++++++++++++++\n t/t9138-git-svn-authors-prog.sh | 25 ++++++++++++++++++++++++-\n 4 files changed, 49 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex b858374649..d59379ee23 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -635,7 +635,8 @@ config key: svn.findcopiesharder\n \n -A<filename>::\n --authors-file=<filename>::\n-\tSyntax is compatible with the file used by 'git cvsimport':\n+\tSyntax is compatible with the file used by 'git cvsimport' but\n+\tan empty email address can be supplied with '<>':\n +\n ------------------------------------------------------------------------\n \tloginname = Joe User <user@example.com>\n@@ -654,8 +655,9 @@ config key: svn.authorsfile\n \tIf this option is specified, for each SVN committer name that\n \tdoes not exist in the authors file, the given file is executed\n \twith the committer name as the first argument.  The program is\n-\texpected to return a single line of the form \"Name <email>\",\n-\twhich will be treated as if included in the authors file.\n+\texpected to return a single line of the form \"Name <email>\" or\n+\t\"Name <>\", which will be treated as if included in the authors\n+\tfile.\n +\n Due to historical reasons a relative 'filename' is first searched\n relative to the current directory for 'init' and 'clone' and relative\ndiff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm\nindex bc4eed3d75..945ca4db2b 100644\n--- a/perl/Git/SVN.pm\n+++ b/perl/Git/SVN.pm\n@@ -1482,7 +1482,6 @@ sub call_authors_prog {\n \t}\n \tif ($author =~ /^\\s*(.+?)\\s*<(.*)>\\s*$/) {\n \t\tmy ($name, $email) = ($1, $2);\n-\t\t$email = undef if length $2 == 0;\n \t\treturn [$name, $email];\n \t} else {\n \t\tdie \"Author: $orig_author: $::_authors_prog returned \"\n@@ -2020,8 +2019,8 @@ sub make_log_entry {\n \t\tremove_username($full_url);\n \t\t$log_entry{metadata} = \"$full_url\\@$r $uuid\";\n \t\t$log_entry{svm_revision} = $r;\n-\t\t$email ||= \"$author\\@$uuid\";\n-\t\t$commit_email ||= \"$author\\@$uuid\";\n+\t\t$email = \"$author\\@$uuid\" unless defined $email;\n+\t\t$commit_email = \"$author\\@$uuid\" unless defined $commit_email;\n \t} elsif ($self->use_svnsync_props) {\n \t\tmy $full_url = canonicalize_url(\n \t\t\tadd_path_to_url( $self->svnsync->{url}, $self->path )\n@@ -2029,15 +2028,15 @@ sub make_log_entry {\n \t\tremove_username($full_url);\n \t\tmy $uuid = $self->svnsync->{uuid};\n \t\t$log_entry{metadata} = \"$full_url\\@$rev $uuid\";\n-\t\t$email ||= \"$author\\@$uuid\";\n-\t\t$commit_email ||= \"$author\\@$uuid\";\n+\t\t$email = \"$author\\@$uuid\" unless defined $email;\n+\t\t$commit_email = \"$author\\@$uuid\" unless defined $commit_email;\n \t} else {\n \t\tmy $url = $self->metadata_url;\n \t\tremove_username($url);\n \t\tmy $uuid = $self->rewrite_uuid || $self->ra->get_uuid;\n \t\t$log_entry{metadata} = \"$url\\@$rev \" . $uuid;\n-\t\t$email ||= \"$author\\@\" . $uuid;\n-\t\t$commit_email ||= \"$author\\@\" . $uuid;\n+\t\t$email = \"$author\\@$uuid\" unless defined $email;\n+\t\t$commit_email = \"$author\\@$uuid\" unless defined $commit_email;\n \t}\n \t$log_entry{name} = $name;\n \t$log_entry{email} = $email;\ndiff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh\nindex 41264818cc..6af6daf461 100755\n--- a/t/t9130-git-svn-authors-file.sh\n+++ b/t/t9130-git-svn-authors-file.sh\n@@ -108,6 +108,20 @@ test_expect_success !MINGW 'fresh clone with svn.authors-file in config' '\n \t)\n '\n \n+cat >> svn-authors <<EOF\n+ff = FFFFFFF FFFFFFF <>\n+EOF\n+\n+test_expect_success 'authors-file imported user without email' '\n+\tsvn_cmd mkdir -m aa/branches/ff --username ff \"$svnrepo/aa/branches/ff\" &&\n+\t(\n+\t\tcd aa-work &&\n+\t\tgit svn fetch --authors-file=../svn-authors &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/origin/ff | \\\n+\t\t  grep \"^author FFFFFFF FFFFFFF <> \"\n+\t)\n+\t'\n+\n test_debug 'GIT_DIR=gitconfig.clone/.git git log'\n \n test_done\ndiff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh\nindex 7d7e9d46bc..0cec56128f 100755\n--- a/t/t9138-git-svn-authors-prog.sh\n+++ b/t/t9138-git-svn-authors-prog.sh\n@@ -9,7 +9,9 @@ test_description='git svn authors prog tests'\n \n write_script svn-authors-prog \"$PERL_PATH\" <<-\\EOF\n \t$_ = shift;\n-\tif (s/-sub$//)  {\n+\tif (s/-hermit//) {\n+\t\tprint \"$_ <>\\n\";\n+\t} elsif (s/-sub$//)  {\n \t\tprint \"$_ <$_\\@sub.example.com>\\n\";\n \t} else {\n \t\tprint \"$_ <$_\\@example.com>\\n\";\n@@ -68,6 +70,27 @@ test_expect_success 'authors-file overrode authors-prog' '\n git --git-dir=x/.git config --unset svn.authorsfile\n git --git-dir=x/.git config --unset svn.authorsprog\n \n+test_expect_success 'authors-prog imported user without email' '\n+\tsvn mkdir -m gg --username gg-hermit \"$svnrepo\"/gg &&\n+\t(\n+\t\tcd x &&\n+\t\tgit svn fetch --authors-prog=../svn-authors-prog &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n+\t\t  grep \"^author gg <> \"\n+\t)\n+'\n+\n+test_expect_success 'imported without authors-prog and authors-file' '\n+\tsvn mkdir -m hh --username hh \"$svnrepo\"/hh &&\n+\t(\n+\t\tuuid=$(svn info --show-item=repos-uuid \"$svnrepo\") &&\n+\t\tcd x &&\n+\t\tgit svn fetch &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n+\t\t  grep \"^author hh <hh@$uuid> \"\n+\t)\n+'\n+\n test_expect_success 'authors-prog handled special characters in username' '\n \tsvn mkdir -m bad --username \"xyz; touch evil\" \"$svnrepo\"/bad &&\n \t(\n-- \n2.16.2\n\n"},{"id":"343851","messageId":"20180405075113.3y6a5nadijswt7pm@untitled","threadId":"48024","inReplyTo":"20180324102046.8840-1-asheiduk@gmail.com","subject":"Re: [PATCH v3] git-svn: allow empty email-address using authors-prog and authors-file","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2018-04-05T07:51:13Z","receivedAt":"2018-04-05T07:51:19Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Thanks for the update.  The patch itself looks good, but I\nnoticed one --show-item isn't supported on SVN 1.8.10 for me.\n\nI've tested the following on both SVN 1.8.10 and 1.9.5:\n\n--- a/t/t9138-git-svn-authors-prog.sh\n+++ b/t/t9138-git-svn-authors-prog.sh\n@@ -83,7 +83,8 @@ test_expect_success 'authors-prog imported user without email' '\n test_expect_success 'imported without authors-prog and authors-file' '\n \tsvn mkdir -m hh --username hh \"$svnrepo\"/hh &&\n \t(\n-\t\tuuid=$(svn info --show-item=repos-uuid \"$svnrepo\") &&\n+\t\tuuid=$(svn info \"$svnrepo\" |\n+\t\t\tsed -n \"s/^Repository UUID: //p\") &&\n \t\tcd x &&\n \t\tgit svn fetch &&\n \t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n\nCan you confirm it's OK for you?  Thanks.\n"},{"id":"343885","messageId":"e2234113-52cf-1443-5abb-70a595037f30@gmail.com","threadId":"48024","inReplyTo":"20180405075113.3y6a5nadijswt7pm@untitled","subject":"Re: [PATCH v3] git-svn: allow empty email-address using authors-prog and authors-file","fromName":"Andreas Heiduk","fromEmail":"asheiduk@gmail.com","sentAt":"2018-04-05T18:23:43Z","receivedAt":"2018-04-05T18:23:52Z","isPatch":true,"sender":{"key":"asheiduk@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9371344?v=4"},"body":"Am 05.04.2018 um 09:51 schrieb Eric Wong:\n> Thanks for the update.  The patch itself looks good, but I\n> noticed one --show-item isn't supported on SVN 1.8.10 for me.\n\n--show-item is indeed a 1.9.0 thing:\n\nhttps://subversion.apache.org/docs/release-notes/1.9.html#svn-info-item\n\n> I've tested the following on both SVN 1.8.10 and 1.9.5:\n> \n> --- a/t/t9138-git-svn-authors-prog.sh\n> +++ b/t/t9138-git-svn-authors-prog.sh\n> @@ -83,7 +83,8 @@ test_expect_success 'authors-prog imported user without email' '\n>  test_expect_success 'imported without authors-prog and authors-file' '\n>  \tsvn mkdir -m hh --username hh \"$svnrepo\"/hh &&\n>  \t(\n> -\t\tuuid=$(svn info --show-item=repos-uuid \"$svnrepo\") &&\n> +\t\tuuid=$(svn info \"$svnrepo\" |\n> +\t\t\tsed -n \"s/^Repository UUID: //p\") &&\n>  \t\tcd x &&\n>  \t\tgit svn fetch &&\n>  \t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n> \n> Can you confirm it's OK for you?  Thanks.\n\nLooks good, works for me.\n\nDo you squash this patch with with my commit or do you need a reroll?\n"},{"id":"343892","messageId":"20180405194421.GA25243@80x24.org","threadId":"48024","inReplyTo":"e2234113-52cf-1443-5abb-70a595037f30@gmail.com","subject":"Re: [PATCH v3] git-svn: allow empty email-address using authors-prog and authors-file","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2018-04-05T19:44:21Z","receivedAt":"2018-04-05T19:44:26Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Andreas Heiduk <asheiduk@gmail.com> wrote:\n> Am 05.04.2018 um 09:51 schrieb Eric Wong:\n> > Can you confirm it's OK for you?  Thanks.\n> \n> Looks good, works for me.\n> \n> Do you squash this patch with with my commit or do you need a reroll?\n\nNope, no need to reroll.  Pushed to my repo for Junio.  Thanks all.\n\nThe following changes since commit 468165c1d8a442994a825f3684528361727cd8c0:\n\n  Git 2.17 (2018-04-02 10:13:35 -0700)\n\nare available in the Git repository at:\n\n  git://bogomips.org/git-svn.git svn/authors-prog-2\n\nfor you to fetch changes up to cb427e9eb0243fe7a1a22ea3bd0a46b7410c0bf3:\n\n  git-svn: allow empty email-address using authors-prog and authors-file (2018-04-05 19:22:06 +0000)\n\n----------------------------------------------------------------\nAndreas Heiduk (2):\n      git-svn: search --authors-prog in PATH too\n      git-svn: allow empty email-address using authors-prog and authors-file\n\n Documentation/git-svn.txt       | 13 ++++++++++---\n git-svn.perl                    |  3 ++-\n perl/Git/SVN.pm                 | 13 ++++++-------\n t/t9130-git-svn-authors-file.sh | 14 ++++++++++++++\n t/t9138-git-svn-authors-prog.sh | 26 +++++++++++++++++++++++++-\n 5 files changed, 57 insertions(+), 12 deletions(-)\n"},{"id":"344505","messageId":"xmqqa7u949i5.fsf@gitster-ct.c.googlers.com","threadId":"48024","inReplyTo":"20180405194421.GA25243@80x24.org","subject":"Re: [PATCH v3] git-svn: allow empty email-address using authors-prog and authors-file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-04-11T23:18:58Z","receivedAt":"2018-04-11T23:19:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <e@80x24.org> writes:\n\n> Andreas Heiduk <asheiduk@gmail.com> wrote:\n>> Am 05.04.2018 um 09:51 schrieb Eric Wong:\n>> > Can you confirm it's OK for you?  Thanks.\n>> \n>> Looks good, works for me.\n>> \n>> Do you squash this patch with with my commit or do you need a reroll?\n>\n> Nope, no need to reroll.  Pushed to my repo for Junio.  Thanks all.\n>\n> The following changes since commit 468165c1d8a442994a825f3684528361727cd8c0:\n>\n>   Git 2.17 (2018-04-02 10:13:35 -0700)\n>\n> are available in the Git repository at:\n>\n>   git://bogomips.org/git-svn.git svn/authors-prog-2\n>\n> for you to fetch changes up to cb427e9eb0243fe7a1a22ea3bd0a46b7410c0bf3:\n>\n>   git-svn: allow empty email-address using authors-prog and authors-file (2018-04-05 19:22:06 +0000)\n\nSorry; this message fell under my radar and I had to privately get\nreminded of it.  Pulled.\n\nThanks, both.\n"}]}