]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'mc/send-email-header-cmd'
authorJunio C Hamano <gitster@pobox.com>
Mon, 15 May 2023 20:59:03 +0000 (13:59 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 May 2023 20:59:03 +0000 (13:59 -0700)
"git send-email" learned "--header-cmd=<cmd>" that can inject
arbitrary e-mail header lines to the outgoing messages.

* mc/send-email-header-cmd:
  send-email: detect empty blank lines in command output
  send-email: add --header-cmd, --no-header-cmd options
  send-email: extract execute_cmd from recipients_cmd

1  2 
Documentation/git-send-email.txt
git-send-email.perl
t/t9001-send-email.sh

Simple merge
index 26e18eebd93a3eeecd03faff92e2cb4124fdf16d,22a64e608f9f9289b0aec48d4a45f5c06d7f34dc..89d8237e89391b4970dd97f8b5c1bbd5321e5e4d
@@@ -2036,12 -2078,11 +2090,12 @@@ sub invoke_header_cmd 
  # 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, $file, $quiet) = @_;
+       my @lines = ();
        my @addresses = ();
-       open my $fh, "-|", "$cmd \Q$file\E"
-           or die sprintf(__("(%s) Could not execute '%s'"), $prefix, $cmd);
-       while (my $address = <$fh>) {
++
+       @lines = execute_cmd($prefix, $cmd, $file);
+       for my $address (@lines) {
                $address =~ s/^\s*//g;
                $address =~ s/\s*$//g;
                $address = sanitize_address($address);
Simple merge