Skip to contentSkip to conversation

Add parsing of elm aliases to git-send-email

PATCH In review Bill Pemberton 2 participants 2 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add parsing of elm aliases to git-send-email

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

---

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(-)
Documentation/git-send-email.txt +1 -1
index 0b1f183..794224b 100644
@@ -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
git-send-email.perl +8 -0
index 172b53c..c08d40c 100755
@@ -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 ];
Signature · 1 line
1.6.0.6