git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] send-email: refactor recipients_cmd()

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Nov 11, 2012, 17:04 UTC
Message-ID
<1352653463-1923-2-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1352653463-1923-1-git-send-email-felipe.contreras@gmail.com>

If we pass the full command to run, we should be able to use it in more extensible ways--see next patch.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 git-send-email.perl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index aea66a0..26d4477 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1373,11 +1373,11 @@ foreach my $t (@files) {
 # Execute a command (e.g. $to_cmd) to get a list of email addresses
 # and return a results array
 sub recipients_cmd {
-	my ($prefix, $what, $cmd, $file) = @_;
+	my ($prefix, $what, $cmd, @args) = @_;
 
 	my $sanitized_sender = sanitize_address($sender);
 	my @addresses = ();
-	open my $fh, "$cmd \Q$file\E |"
+	open my $fh, "-|", $cmd, @args
 	    or die "($prefix) Could not execute '$cmd'";
 	while (my $address = <$fh>) {
 		$address =~ s/^\s*//g;
-- 
1.8.0
Previous: Felipe ContrerasNext: Felipe Contreras
Message 2 of 11 in “send-email: new series-cc-cmd option”
  1. 0/2 send-email: new series-cc-cmd optionFelipe Contreras, Nov 11, 2012
  2. 1/2 send-email: refactor recipients_cmd()Felipe Contreras, Nov 11, 2012
  3. 2/2 send-email: add series-cc-cmd optionFelipe Contreras, Nov 11, 2012
  4. Ramkumar RamachandraNov 12, 2012
  5. Joe PerchesNov 12, 2012
  6. Felipe ContrerasNov 12, 2012
  7. Joe PerchesNov 12, 2012
  8. Felipe ContrerasNov 12, 2012
  9. Joe PerchesNov 12, 2012
  10. Junio C HamanoNov 13, 2012
  11. Felipe ContrerasNov 13, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.