git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] send-email: ignore trailing whitespace in mailrc alias file
@ 2016-03-17 22:08 Stefan Beller
  2016-03-17 23:58 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Beller @ 2016-03-17 22:08 UTC (permalink / raw)
  To: peff, gitster; +Cc: git, Stefan Beller

From: Jeff King <peff@peff.net>

This fixes send-email which would not work with mailrc alias files
which had trailing whitespaces.

Signed-off-by: Stefan Beller <sbeller@google.com>
---

> On Thu, Mar 17, 2016 at 10:47:50AM -0700, Stefan Beller wrote:
>
> sent from git-send-email with a corrupt .mailrc file.
> 
> Great, but could probably use a better commit message. ;P
> 
> -Peff

Uhm, yes. Why do you ask? ;) 
I forgot again that it is too late to edit the patch when send-email asks:
> Send this email? ([y]es|[n]o|[q]uit|[a]ll): 
as it has read the patch from disk and keeps it in memory I assume?

I just wrote the commit message as I would do, but offer you to claim authorship
for that perl stuff. So in case you'd want to reword that, I'd ask you to that.
Also asking for your signoff. (But apart from that I consider this patch final.)

Thanks,
Stefan

diff --git a/git-send-email.perl b/git-send-email.perl
index d356901..c45b22a 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -533,7 +533,7 @@ my %parse_alias = (
 			$aliases{$alias} = \@addr
 		}}},
 	mailrc => sub { my $fh = shift; while (<$fh>) {
-		if (/^alias\s+(\S+)\s+(.*)$/) {
+		if (/^alias\s+(\S+)\s+(.*?)\s*$/) {
 			# spaces delimit multiple addresses
 			$aliases{$1} = [ quotewords('\s+', 0, $2) ];
 		}}},

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-17 23:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-17 22:08 [PATCH] send-email: ignore trailing whitespace in mailrc alias file Stefan Beller
2016-03-17 23:58 ` Jeff King

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 NNTP newsgroup(s).