# [PATCH] Add parsing of elm aliases to git-send-email

2 messages from 2009-04-22 to 2009-04-23. Participants: Bill Pemberton, Junio C Hamano.
Thread: https://gitlist.dev/t/19002

## Bill Pemberton, 2009-04-22 13:41

Subject: [PATCH] Add parsing of elm aliases to git-send-email
Message-ID: <1240407689-19500-1-git-send-email-wfp5p@virginia.edu>
URL: https://gitlist.dev/e/1240407689-19500-1-git-send-email-wfp5p%40virginia.edu

```
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>
---

I'm probably the only one that still uses elm, but hey, it's an easy 
parser to add.

 Documentation/git-send-email.txt |    2 +-
 git-send-email.perl              |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 0b1f183..794224b 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -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
diff --git a/git-send-email.perl b/git-send-email.perl
index 172b53c..c08d40c 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -418,6 +418,14 @@ my %parse_alias = (
 			$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 ];
-- 
1.6.0.6

```

## Junio C Hamano, 2009-04-23 04:21

Subject: Re: [PATCH] Add parsing of elm aliases to git-send-email
Message-ID: <7vbpqoxank.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vbpqoxank.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <1240407689-19500-1-git-send-email-wfp5p@virginia.edu>

```
Thanks.

```
