-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jk/send-email-complete-aliases'
Teach send-email to dump mail aliases, so that we can do tab completion on the command line. * jk/send-email-complete-aliases: completion: add support for completing email aliases sendemail: teach git-send-email to dump alias names
- Loading branch information
Showing
4 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1555,6 +1555,88 @@ test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' ' | |
grep "^!someone@example\.org!$" commandline1 | ||
' | ||
|
||
test_dump_aliases () { | ||
msg="$1" && shift && | ||
filetype="$1" && shift && | ||
printf '%s\n' "$@" >expect && | ||
cat >.tmp-email-aliases && | ||
|
||
test_expect_success $PREREQ "$msg" ' | ||
clean_fake_sendmail && rm -fr outdir && | ||
git config --replace-all sendemail.aliasesfile \ | ||
"$(pwd)/.tmp-email-aliases" && | ||
git config sendemail.aliasfiletype "$filetype" && | ||
git send-email --dump-aliases 2>errors >actual && | ||
test_cmp expect actual | ||
' | ||
} | ||
|
||
test_dump_aliases '--dump-aliases sendmail format' \ | ||
'sendmail' \ | ||
'abgroup' \ | ||
'alice' \ | ||
'bcgrp' \ | ||
'bob' \ | ||
'chloe' <<-\EOF | ||
alice: Alice W Land <[email protected]> | ||
bob: Robert Bobbyton <[email protected]> | ||
chloe: [email protected] | ||
abgroup: alice, bob | ||
bcgrp: bob, chloe, Other <[email protected]> | ||
EOF | ||
|
||
test_dump_aliases '--dump-aliases mutt format' \ | ||
'mutt' \ | ||
'alice' \ | ||
'bob' \ | ||
'chloe' \ | ||
'donald' <<-\EOF | ||
alias alice Alice W Land <[email protected]> | ||
alias donald Donald C Carlton <[email protected]> | ||
alias bob Robert Bobbyton <[email protected]> | ||
alias chloe [email protected] | ||
EOF | ||
|
||
test_dump_aliases '--dump-aliases mailrc format' \ | ||
'mailrc' \ | ||
'alice' \ | ||
'bob' \ | ||
'chloe' \ | ||
'eve' <<-\EOF | ||
alias alice Alice W Land <[email protected]> | ||
alias eve Eve <[email protected]> | ||
alias bob Robert Bobbyton <[email protected]> | ||
alias chloe [email protected] | ||
EOF | ||
|
||
test_dump_aliases '--dump-aliases pine format' \ | ||
'pine' \ | ||
'alice' \ | ||
'bob' \ | ||
'chloe' \ | ||
'eve' <<-\EOF | ||
alice Alice W Land <[email protected]> | ||
eve Eve <[email protected]> | ||
bob Robert Bobbyton <[email protected]> | ||
chloe [email protected] | ||
EOF | ||
|
||
test_dump_aliases '--dump-aliases gnus format' \ | ||
'gnus' \ | ||
'alice' \ | ||
'bob' \ | ||
'chloe' \ | ||
'eve' <<-\EOF | ||
(define-mail-alias "alice" "[email protected]") | ||
(define-mail-alias "eve" "[email protected]") | ||
(define-mail-alias "bob" "[email protected]") | ||
(define-mail-alias "chloe" "[email protected]") | ||
EOF | ||
|
||
test_expect_success '--dump-aliases must be used alone' ' | ||
test_must_fail git send-email --dump-aliases [email protected] -1 refs/heads/accounting | ||
' | ||
|
||
test_sendmail_aliases () { | ||
msg="$1" && shift && | ||
expect="$@" && | ||
|