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

[PATCH 2/2] git-svn: allow empty email-address in authors-prog and authors-file

From
Andreas Heiduk <asheiduk@gmail.com>
Date
Mar 4, 2018, 11:22 UTC
Message-ID
<20180304112237.19254-2-asheiduk@gmail.com>
In-Reply-To
<20180304112237.19254-1-asheiduk@gmail.com>

The email address in --authors-file and --authors-prog can be empty but git-svn translated it into a syntethic email address in the form $USERNAME@$REPO_UUID. Now git-svn behaves like git-commit: If the email is explicitly set to the empty string, the commit does not contain an email address.

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
---
 perl/Git/SVN.pm | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
index bc4eed3d75..b0a340b294 100644
--- a/perl/Git/SVN.pm
+++ b/perl/Git/SVN.pm
@@ -1482,7 +1482,6 @@ sub call_authors_prog {
 	}
 	if ($author =~ /^\s*(.+?)\s*<(.*)>\s*$/) {
 		my ($name, $email) = ($1, $2);
-		$email = undef if length $2 == 0;
 		return [$name, $email];
 	} else {
 		die "Author: $orig_author: $::_authors_prog returned "
@@ -2020,8 +2019,8 @@ sub make_log_entry {
 		remove_username($full_url);
 		$log_entry{metadata} = "$full_url\@$r $uuid";
 		$log_entry{svm_revision} = $r;
-		$email ||= "$author\@$uuid";
-		$commit_email ||= "$author\@$uuid";
+		$email //= "$author\@$uuid";
+		$commit_email //= "$author\@$uuid";
 	} elsif ($self->use_svnsync_props) {
 		my $full_url = canonicalize_url(
 			add_path_to_url( $self->svnsync->{url}, $self->path )
@@ -2029,15 +2028,15 @@ sub make_log_entry {
 		remove_username($full_url);
 		my $uuid = $self->svnsync->{uuid};
 		$log_entry{metadata} = "$full_url\@$rev $uuid";
-		$email ||= "$author\@$uuid";
-		$commit_email ||= "$author\@$uuid";
+		$email //= "$author\@$uuid";
+		$commit_email //= "$author\@$uuid";
 	} else {
 		my $url = $self->metadata_url;
 		remove_username($url);
 		my $uuid = $self->rewrite_uuid || $self->ra->get_uuid;
 		$log_entry{metadata} = "$url\@$rev " . $uuid;
-		$email ||= "$author\@" . $uuid;
-		$commit_email ||= "$author\@" . $uuid;
+		$email //= "$author\@" . $uuid;
+		$commit_email //= "$author\@" . $uuid;
 	}
 	$log_entry{name} = $name;
 	$log_entry{email} = $email;
-- 
2.16.2
Previous: Andreas HeidukNext: Eric Sunshine
Message 2 of 11 in “git-svn: search --authors-prog in PATH too”
  1. 1/2 git-svn: search --authors-prog in PATH tooAndreas Heiduk, Mar 4, 2018
  2. 2/2 git-svn: allow empty email-address in authors-prog and authors-fileAndreas Heiduk, Mar 4, 2018
  3. Eric SunshineMar 5, 2018
  4. Andreas HeidukMar 5, 2018
  5. Eric WongMar 5, 2018
  6. Eric SunshineMar 5, 2018
  7. Andreas HeidukMar 6, 2018
  8. Eric SunshineMar 5, 2018
  9. Eric WongMar 5, 2018
  10. Andreas HeidukMar 5, 2018
  11. Andreas HeidukMar 5, 2018

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.