aboutsummaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2007-08-17 18:51:12 -0700
committerJunio C Hamano <gitster@pobox.com>2007-08-17 19:03:32 -0700
commit324a8bd0cfb696458bc651d3713d7523fd0d7479 (patch)
treeb27b3723a767336a278257394943eb96851424db /git-send-email.perl
parenta9ab2009dbbf769aadd52957950c1bad60a0c8fd (diff)
downloadgit-324a8bd0cfb696458bc651d3713d7523fd0d7479.tar.gz
git-324a8bd0cfb696458bc651d3713d7523fd0d7479.tar.xz
git-send-email --cc-cmd
This new option allows an arbitrary "cmd" to generate per patch file specific "Cc:"s. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl24
1 files changed, 22 insertions, 2 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 69559b289..4767249e6 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -46,6 +46,9 @@ Options:
--cc Specify an initial "Cc:" list for the entire series
of emails.
+ --cc-cmd Specify a command to execute per file which adds
+ per file specific cc address entries
+
--bcc Specify a list of email addresses that should be Bcc:
on all the emails.
@@ -157,13 +160,14 @@ if ($@) {
my ($quiet, $dry_run) = (0, 0);
# Variables with corresponding config settings
-my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc);
+my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);
my %config_settings = (
"thread" => [\$thread, 1],
"chainreplyto" => [\$chain_reply_to, 1],
"suppressfrom" => [\$suppress_from, 0],
"signedoffcc" => [\$signed_off_cc, 1],
+ "cccmd" => [\$cc_cmd, ""],
);
foreach my $setting (keys %config_settings) {
@@ -189,6 +193,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
"smtp-server=s" => \$smtp_server,
"compose" => \$compose,
"quiet" => \$quiet,
+ "cc-cmd=s" => \$cc_cmd,
"suppress-from!" => \$suppress_from,
"signed-off-cc|signed-off-by-cc!" => \$signed_off_cc,
"dry-run" => \$dry_run,
@@ -652,11 +657,26 @@ foreach my $t (@files) {
}
}
close F;
+
+ if ($cc_cmd ne "") {
+ open(F, "$cc_cmd $t |")
+ or die "(cc-cmd) Could not execute '$cc_cmd'";
+ while(<F>) {
+ my $c = $_;
+ $c =~ s/^\s*//g;
+ $c =~ s/\n$//g;
+ push @cc, $c;
+ printf("(cc-cmd) Adding cc: %s from: '%s'\n",
+ $c, $cc_cmd) unless $quiet;
+ }
+ close F
+ or die "(cc-cmd) failed to close pipe to '$cc_cmd'";
+ }
+
if (defined $author) {
$message = "From: $author\n\n$message";
}
-
send_message();
# set up for the next message