Skip to content

Commit

Permalink
Add parsing of elm aliases to git-send-email
Browse files Browse the repository at this point in the history
elm stores a text file version of the aliases that is
<alias> = <comment> = <email address>

This adds the parsing of this file to git-send-email

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Bill Pemberton authored and Junio C Hamano committed Apr 23, 2009
1 parent 7bd93c1 commit 7613ea3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/git-send-email.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ sendemail.aliasesfile::

sendemail.aliasfiletype::
Format of the file(s) specified in sendemail.aliasesfile. Must be
one of 'mutt', 'mailrc', 'pine', or 'gnus'.
one of 'mutt', 'mailrc', 'pine', 'elm', or 'gnus'.

sendemail.multiedit::
If true (default), a single editor instance will be spawned to edit
Expand Down
8 changes: 8 additions & 0 deletions git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,14 @@ sub split_addrs {
$x =~ /^(\S+)$f\t\(?([^\t]+?)\)?(:?$f){0,2}$/ or next;
$aliases{$1} = [ split_addrs($2) ];
}},
elm => sub { my $fh = shift;
while (<$fh>) {
if (/^(\S+)\s+=\s+[^=]+=\s(\S+)/) {
my ($alias, $addr) = ($1, $2);
$aliases{$alias} = [ split_addrs($addr) ];
}
} },

gnus => sub { my $fh = shift; while (<$fh>) {
if (/\(define-mail-alias\s+"(\S+?)"\s+"(\S+?)"\)/) {
$aliases{$1} = [ $2 ];
Expand Down

0 comments on commit 7613ea3

Please sign in to comment.