All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Rene Herman <rene.herman@gmail.com>,
	git@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Arjan van de Ven <arjan@infradead.org>,
	Trond Myklebust <trond.myklebust@fys.uio.no>,
	Mariusz Kozlowski <m.kozlowski@tuxland.pl>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	torvalds@linux-foundation.org
Subject: Re: [PATCH] - git-send-email.perl
Date: Fri, 17 Aug 2007 18:51:12 -0700	[thread overview]
Message-ID: <1187401873.822.146.camel@localhost> (raw)
In-Reply-To: <7vy7g9enqd.fsf@gitster.siamese.dyndns.org>

On Fri, 2007-08-17 at 16:38 -0700, Junio C Hamano wrote:
> Joe Perches <joe@perches.com> writes:
> ... Signed-off-by: ...
> I do not see a patch to "Documentation/git-send-email.txt" here...
> Something like this, with appropriate error checking, perhaps?
> 
> 	open my $cc, "${cc_cmd} $t |";
>         while (my $c = <$cc>) {
>         	...
> 	}
>         close $cc;

Add --cc-cmd, the ability to execute an arbitrary "cmd" to
generate per patch file specific "Cc:"s to git-send-email.perl

Signed-off-by: Joe Perches <joe@perches.com>

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index d243ed1..9a48847 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 69559b2..d49947c 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,25 @@ foreach my $t (@files) {
 		}
 	}
 	close F;
+
+	if (${cc_cmd} ne "") {
+	    open(F, "${cc_cmd} $t |")
+		or die "(cc-cmd) Could not execute '${cc_cmd}'\n";
+	    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;
+	}
+
 	if (defined $author) {
 		$message = "From: $author\n\n$message";
 	}
 
-
 	send_message();
 
 	# set up for the next message



  reply	other threads:[~2007-08-18  1:52 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-13  5:49 [PATCH] [1/2many] - FInd the maintainer(s) for a patch - scripts/get_maintainer.pl Joe Perches
2007-08-13  6:42 ` Michal Piotrowski
2007-08-13  7:16 ` Al Viro
2007-08-13 16:22   ` Sam Ravnborg
2007-08-13 17:40   ` Rene Herman
2007-08-13 15:43 ` Kok, Auke
2007-08-13 19:40   ` Richard Knutsson
2007-08-13 20:28     ` Kok, Auke
2007-08-13 20:43       ` Richard Knutsson
2007-08-13 17:09 ` Ray Lee
2007-08-13 18:11   ` Valdis.Kletnieks
2007-08-13 21:04   ` Adrian Bunk
2007-08-13 17:33 ` Mariusz Kozlowski
2007-08-13 17:42   ` Arjan van de Ven
2007-08-13 18:07     ` Mariusz Kozlowski
2007-08-13 18:10     ` Rene Herman
2007-08-13 18:32     ` Satyam Sharma
2007-08-13 19:21       ` Jan Engelhardt
2007-08-13 19:53         ` Richard Knutsson
2007-08-13 20:05         ` Valdis.Kletnieks
2007-08-13 18:41     ` Krzysztof Halasa
2007-08-13 19:02       ` Krzysztof Halasa
2007-08-13 20:16       ` Theodore Tso
2007-08-13 20:37     ` Trond Myklebust
2007-08-14  1:19       ` Arjan van de Ven
2007-08-14  1:48         ` John W. Linville
2007-08-14  1:51         ` Rene Herman
2007-08-14  2:04           ` Rene Herman
2007-08-14  9:20           ` Alan Cox
2007-08-14 13:47             ` Arjan van de Ven
2007-08-14 14:28               ` Adrian Bunk
2007-08-14 14:33                 ` Arjan van de Ven
2007-08-14 15:53             ` Rene Herman
2007-08-14 17:00               ` Joe Perches
2007-08-14 18:03                 ` Rene Herman
2007-08-14 18:28                   ` Joe Perches
2007-08-14 18:33                     ` Rene Herman
2007-08-14 18:40                     ` Linus Torvalds
2007-08-14 18:54                       ` Joe Perches
2007-08-14 19:33                       ` Al Viro
2007-08-14 19:57                         ` Joe Perches
2007-08-15  1:19                         ` Rene Herman
2007-08-15 13:33                           ` Satyam Sharma
2007-08-15 13:39                             ` Rene Herman
2007-08-15 13:52                               ` Kyle Moffett
2007-08-16 10:58                                 ` Rene Herman
2007-08-16 11:08                                   ` Rene Herman
2007-08-16 11:26                                     ` Salikh Zakirov
2007-08-16 11:26                                       ` Salikh Zakirov
2007-08-16 11:57                                       ` Rene Herman
2007-08-16 15:40                                   ` Al Viro
2007-08-16 15:53                                     ` Rene Herman
2007-08-16 19:00                                   ` Junio C Hamano
2007-08-17  4:24                                     ` Rene Herman
2007-08-15 19:37                         ` Krzysztof Halasa
2007-08-15 23:19                           ` Al Viro
2007-08-15  1:35                       ` Richard Knutsson
2007-08-15  9:29                       ` Stefan Richter
2007-08-15 15:31                         ` Ray Lee
2007-08-16 20:36                       ` Joe Perches
2007-08-15  1:31                 ` Junio C Hamano
2007-08-15  2:12                   ` Joe Perches
2007-08-15  5:25                     ` Junio C Hamano
2007-08-15  5:42                       ` Rene Herman
2007-08-15  9:39                     ` Stefan Richter
2007-08-15 11:44                       ` Rene Herman
2007-08-15 17:26                         ` Joe Perches
2007-08-17  2:13                   ` Joe Perches
2007-08-17  2:30                     ` Joe Perches
2007-08-17 17:54                       ` [PATCH] - git-send-email.perl Joe Perches
2007-08-17 23:38                         ` Junio C Hamano
2007-08-18  1:51                           ` Joe Perches [this message]
2007-08-14 14:22         ` [PATCH] [1/2many] - FInd the maintainer(s) for a patch - scripts/get_maintainer.pl Adrian Bunk
2007-08-14 14:33           ` Arjan van de Ven
2007-08-14 14:45           ` John W. Linville
2007-08-14  2:15     ` Manu Abraham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1187401873.822.146.camel@localhost \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjan@infradead.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.kozlowski@tuxland.pl \
    --cc=rene.herman@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=trond.myklebust@fys.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.