{"thread":{"id":"51901","subject":"[PATCH] git-svn: trim leading and trailing whitespaces in author name","startedAt":"2019-09-23T09:55:59Z","lastAt":"2019-09-23T09:55:59Z","messageCount":1,"participants":["Tobias Klauser"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"382759","messageId":"20190923095554.579-1-tklauser@distanz.ch","threadId":"51901","inReplyTo":null,"subject":"[PATCH] git-svn: trim leading and trailing whitespaces in author name","fromName":"Tobias Klauser","fromEmail":"tklauser@distanz.ch","sentAt":"2019-09-23T09:55:54Z","receivedAt":"2019-09-23T09:55:59Z","isPatch":true,"sender":{"key":"tklauser@distanz.ch","avatar":"https://avatars.githubusercontent.com/u/539708?v=4"},"body":"In some cases, the svn author names might contain leading or trailing\nwhitespaces, leading to messages such as:\n\n  Author: user1\n   not defined in authors.txt\n\n(the trailing newline leads to the line break). The user \"user1\" is\ndefined in authors.txt though, e.g.\n\n  user1 = User <user1@example.com>\n\nFix this by trimming the author name retreived from svn before using it\nin check_author.\n\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Tobias Klauser <tklauser@distanz.ch>\n---\n perl/Git/SVN.pm | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm\nindex 76b29659057d..4b28b8778474 100644\n--- a/perl/Git/SVN.pm\n+++ b/perl/Git/SVN.pm\n@@ -1491,6 +1491,10 @@ sub call_authors_prog {\n \n sub check_author {\n \tmy ($author) = @_;\n+\tif (defined $author) {\n+\t\t$author =~ s/^\\s+//g;\n+\t\t$author =~ s/\\s+$//g;\n+\t}\n \tif (!defined $author || length $author == 0) {\n \t\t$author = '(no author)';\n \t}\n-- \n2.23.0.257.gbff4bb1fe750\n\n"}]}