summaryrefslogtreecommitdiffstats
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2009-11-26 20:04:29 +0100
committerJunio C Hamano <gitster@pobox.com>2009-11-28 08:45:24 +0100
commitc89e32414516e906520e9bdd809560971eb52ef5 (patch)
tree27e55645be6ab932e7c38369392f0b5679c0adce /git-send-email.perl
parentt9001: test --envelope-sender option of send-email (diff)
downloadgit-c89e32414516e906520e9bdd809560971eb52ef5.tar.xz
git-c89e32414516e906520e9bdd809560971eb52ef5.zip
send-email: automatic envelope sender
This adds the option to specify the envelope sender as "auto" which would pick the 'from' address. This is good because now we can specify the address only in one place in $HOME/.gitconfig and change it easily. [jc: added tests] Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index f5ba4e7699..9f44e2964a 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -861,7 +861,9 @@ X-Mailer: git-send-email $gitversion
my @sendmail_parameters = ('-i', @recipients);
my $raw_from = $sanitized_sender;
- $raw_from = $envelope_sender if (defined $envelope_sender);
+ if (defined $envelope_sender && $envelope_sender ne "auto") {
+ $raw_from = $envelope_sender;
+ }
$raw_from = extract_valid_address($raw_from);
unshift (@sendmail_parameters,
'-f', $raw_from) if(defined $envelope_sender);