From: Andreas Heiduk <asheiduk@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: Eric Wong <e@80x24.org>, Andreas Heiduk <asheiduk@gmail.com>
Subject: [PATCH 2/2] git-svn: allow empty email-address in authors-prog and authors-file
Date: Sun, 4 Mar 2018 12:22:37 +0100 [thread overview]
Message-ID: <20180304112237.19254-2-asheiduk@gmail.com> (raw)
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
next prev parent reply other threads:[~2018-03-04 11:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-04 11:22 [PATCH 1/2] git-svn: search --authors-prog in PATH too Andreas Heiduk
2018-03-04 11:22 ` Andreas Heiduk [this message]
2018-03-05 1:42 ` [PATCH 2/2] git-svn: allow empty email-address in authors-prog and authors-file Eric Sunshine
2018-03-05 9:37 ` Andreas Heiduk
2018-03-05 20:20 ` Eric Wong
2018-03-05 22:22 ` Eric Sunshine
2018-03-06 22:24 ` Andreas Heiduk
2018-03-05 0:52 ` [PATCH 1/2] git-svn: search --authors-prog in PATH too Eric Sunshine
2018-03-05 17:52 ` Eric Wong
2018-03-05 19:48 ` Andreas Heiduk
2018-03-05 20:16 ` Andreas Heiduk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180304112237.19254-2-asheiduk@gmail.com \
--to=asheiduk@gmail.com \
--cc=e@80x24.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).