summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-09-01 20:15:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-09-01 20:15:27 (GMT)
commit4e837a98b65fbe0c83376cae5167605b771421d8 (patch)
tree6a7526e919a30ee7b8a96f0dd5c88728452b364e
parenta94eda65d37149e81356b6a263ce03015d3f5d73 (diff)
parent324a8bd0cfb696458bc651d3713d7523fd0d7479 (diff)
downloadgit-4e837a98b65fbe0c83376cae5167605b771421d8.zip
git-4e837a98b65fbe0c83376cae5167605b771421d8.tar.gz
git-4e837a98b65fbe0c83376cae5167605b771421d8.tar.bz2
Merge branch 'jp/send-email-cc'
* jp/send-email-cc: git-send-email --cc-cmd
-rw-r--r--Documentation/git-send-email.txt9
-rwxr-xr-xgit-send-email.perl24
2 files changed, 31 insertions, 2 deletions
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 8231286..16bfd7b 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -34,6 +34,12 @@ The --bcc option must be repeated for each user you want on the bcc list.
+
The --cc option must be repeated for each user you want on the cc list.
+--cc-cmd::
+ Specify a command to execute once per patch file which
+ should generate patch file specific "Cc:" entries.
+ Output of this command must be single email address per line.
+ Default is the value of 'sendemail.cccmd' configuration value.
+
--chain-reply-to, --no-chain-reply-to::
If this is set, each email will be sent as a reply to the previous
email sent. If disabled with "--no-chain-reply-to", all emails after
@@ -124,6 +130,9 @@ sendemail.aliasfiletype::
Format of the file(s) specified in sendemail.aliasesfile. Must be
one of 'mutt', 'mailrc', 'pine', or 'gnus'.
+sendemail.cccmd::
+ Command to execute to generate per patch file specific "Cc:"s.
+
sendemail.bcc::
Email address (or alias) to always bcc.
diff --git a/git-send-email.perl b/git-send-email.perl
index f1a8855..e0b7d12 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -49,6 +49,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.
@@ -160,13 +163,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) {
@@ -192,6 +196,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,
@@ -655,11 +660,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