mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Tobias Klauser <>
Cc:, Eric Sunshine <>
Subject: [PATCH] git-svn: trim leading and trailing whitespaces in author name
Date: Mon, 23 Sep 2019 11:55:54 +0200	[thread overview]
Message-ID: <> (raw)

In some cases, the svn author names might contain leading or trailing
whitespaces, leading to messages such as:

  Author: user1
   not defined in authors.txt

(the trailing newline leads to the line break). The user "user1" is
defined in authors.txt though, e.g.

  user1 = User <>

Fix this by trimming the author name retreived from svn before using it
in check_author.

Helped-by: Eric Sunshine <>
Signed-off-by: Tobias Klauser <>
 perl/Git/ | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/perl/Git/ b/perl/Git/
index 76b29659057d..4b28b8778474 100644
--- a/perl/Git/
+++ b/perl/Git/
@@ -1491,6 +1491,10 @@ sub call_authors_prog {
 sub check_author {
 	my ($author) = @_;
+	if (defined $author) {
+		$author =~ s/^\s+//g;
+		$author =~ s/\s+$//g;
+	}
 	if (!defined $author || length $author == 0) {
 		$author = '(no author)';

             reply	other threads:[~2019-09-23  9:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-23  9:55 Tobias Klauser [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-09-12 11:52 [PATCH] git-svn: trim leading and trailing whitespaces in author name Tobias Klauser
2019-09-12 14:47 ` Eric Sunshine
2019-09-12 14:51   ` Tobias Klauser

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:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* 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

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).