summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorLibravatar Eric Sunshine <sunshine@sunshineco.com>2015-05-31 18:29:29 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-06-01 15:53:11 -0700
commit2532dd0605b15eeed41312558bf5babb50290236 (patch)
treee5cf878d1268c705a4bf07a90ba00a5bb726a1ec /git-send-email.perl
parentsend-email: simplify sendmail aliases comment and blank line recognizer (diff)
downloadtgif-2532dd0605b15eeed41312558bf5babb50290236.tar.xz
send-email: implement sendmail aliases line continuation support
Logical lines in sendmail aliases files can be spread over multiple physical lines[1]. A line beginning with whitespace is folded into the preceding line. A line ending with '\' consumes the following line. [1]: https://www.freebsd.org/cgi/man.cgi?query=aliases&sektion=5 Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl10
1 files changed, 7 insertions, 3 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index e777bd3a60..eb1d678fb0 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -492,8 +492,6 @@ sub parse_sendmail_alias {
local $_ = shift;
if (/"/) {
print STDERR "warning: sendmail alias with quotes is not supported: $_\n";
- } elsif (/^\s|\\$/) {
- print STDERR "warning: sendmail continuation line is not supported: $_\n";
} elsif (/^(\S+?)\s*:\s*(.+)$/) {
my ($alias, $addr) = ($1, $2);
$aliases{$alias} = [ split_addrs($addr) ];
@@ -504,10 +502,16 @@ sub parse_sendmail_alias {
sub parse_sendmail_aliases {
my $fh = shift;
+ my $s = '';
while (<$fh>) {
+ chomp;
next if /^\s*$/ || /^\s*#/;
- parse_sendmail_alias($_);
+ $s .= $_, next if $s =~ s/\\$// || s/^\s+//;
+ parse_sendmail_alias($s) if $s;
+ $s = $_;
}
+ $s =~ s/\\$//; # silently tolerate stray '\' on last line
+ parse_sendmail_alias($s) if $s;
}
my %parse_alias = (