bug#58813: [PATCH 1/5] gnu: git: Apply patch adding the --header-cmd feature.

2023-04-23 Thread Maxim Cournoyer
Hi Liliana,

Liliana Marie Prikler  writes:

> Am Sonntag, dem 23.04.2023 um 12:04 -0400 schrieb Maxim Cournoyer:
>> In preparation to fix .
>> 
>> * gnu/packages/patches/git-header-cmd.patch: New file.
>> * gnu/local.mk (dist_patch_DATA): Register it.
>> * gnu/packages/version-control.scm (git) [source]: Apply patch.
>> ---
> Don't forget to also send this patch to git proper.  I'm sure that
> other distros will have a use for it.

Already the case (see the top comment in the patch itself) :-).

-- 
Thanks,
Maxim





bug#58813: [PATCH 1/5] gnu: git: Apply patch adding the --header-cmd feature.

2023-04-23 Thread Liliana Marie Prikler
Am Sonntag, dem 23.04.2023 um 12:04 -0400 schrieb Maxim Cournoyer:
> In preparation to fix .
> 
> * gnu/packages/patches/git-header-cmd.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register it.
> * gnu/packages/version-control.scm (git) [source]: Apply patch.
> ---
Don't forget to also send this patch to git proper.  I'm sure that
other distros will have a use for it.

Cheers





bug#58813: [PATCH 1/5] gnu: git: Apply patch adding the --header-cmd feature.

2023-04-23 Thread Maxim Cournoyer
In preparation to fix .

* gnu/packages/patches/git-header-cmd.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/version-control.scm (git) [source]: Apply patch.
---
 gnu/local.mk  |   1 +
 gnu/packages/patches/git-header-cmd.patch | 180 ++
 gnu/packages/version-control.scm  |   3 +-
 3 files changed, 183 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/git-header-cmd.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index b631fa6d5a..d7c7ca48e7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1209,6 +1209,7 @@ dist_patch_DATA = 
\
   %D%/packages/patches/gemmi-fix-sajson-types.patch\
   %D%/packages/patches/genimage-mke2fs-test.patch  \
   %D%/packages/patches/geoclue-config.patch\
+  %D%/packages/patches/git-header-cmd.patch\
   %D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch\
   %D%/packages/patches/ghc-9.2-glibc-2.33-link-order.patch \
   %D%/packages/patches/ghc-testsuite-dlopen-pie.patch  \
diff --git a/gnu/packages/patches/git-header-cmd.patch 
b/gnu/packages/patches/git-header-cmd.patch
new file mode 100644
index 00..fdd34fe4a4
--- /dev/null
+++ b/gnu/packages/patches/git-header-cmd.patch
@@ -0,0 +1,180 @@
+Add a '--header-cmd' to git send-email.
+
+Upstream status can be tracked at:
+https://lore.kernel.org/git/20230423122744.4865-1-maxim.courno...@gmail.com/T/#t
+
+diff --git a/Documentation/config/sendemail.txt 
b/Documentation/config/sendemail.txt
+index 51da7088a8..3d0f516520 100644
+--- a/Documentation/config/sendemail.txt
 b/Documentation/config/sendemail.txt
+@@ -58,6 +58,7 @@ sendemail.annotate::
+ sendemail.bcc::
+ sendemail.cc::
+ sendemail.ccCmd::
++sendemail.headerCmd::
+ sendemail.chainReplyTo::
+ sendemail.envelopeSender::
+ sendemail.from::
+diff --git a/Documentation/git-send-email.txt 
b/Documentation/git-send-email.txt
+index b0f438ec99..354c0d06db 100644
+--- a/Documentation/git-send-email.txt
 b/Documentation/git-send-email.txt
+@@ -320,6 +320,11 @@ Automating
+   Output of this command must be single email address per line.
+   Default is the value of `sendemail.ccCmd` configuration value.
+ 
++--header-cmd=::
++  Specify a command to execute once per patch file which should
++  generate arbitrary, patch file specific header entries.
++  Default is the value of `sendemail.headerCmd` configuration value.
++
+ --[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
+diff --git a/git-send-email.perl b/git-send-email.perl
+index fd8cd0d46f..676dd83d89 100755
+--- a/git-send-email.perl
 b/git-send-email.perl
+@@ -2,6 +2,7 @@
+ #
+ # Copyright 2002,2005 Greg Kroah-Hartman 
+ # Copyright 2005 Ryan Anderson 
++# Copyright 2023 Maxim Cournoyer 
+ #
+ # GPL v2 (See COPYING)
+ #
+@@ -87,8 +88,9 @@ sub usage {
+ 
+   Automating:
+ --identity* Use the sendemail. options.
+---to-cmd  * Email To: via ` \$patch_path`
+---cc-cmd  * Email Cc: via ` \$patch_path`
++--to-cmd  * Email To: via ` \$patch_path`.
++--cc-cmd  * Email Cc: via ` \$patch_path`.
++--header-cmd  * Add headers via ` \$patch_path`.
+ --suppress-cc * author, self, sob, cc, cccmd, body, 
bodycc, misc-by, all.
+ --[no-]cc-cover* Email Cc: addresses in the cover letter.
+ --[no-]to-cover* Email To: addresses in the cover letter.
+@@ -269,7 +271,7 @@ sub do_edit {
+ # Variables with corresponding config settings
+ my ($suppress_from, $signed_off_by_cc);
+ my ($cover_cc, $cover_to);
+-my ($to_cmd, $cc_cmd);
++my ($to_cmd, $cc_cmd, $header_cmd);
+ my ($smtp_server, $smtp_server_port, @smtp_server_options);
+ my ($smtp_authuser, $smtp_encryption, $smtp_ssl_cert_path);
+ my ($batch_size, $relogin_delay);
+@@ -318,6 +320,7 @@ sub do_edit {
+ "tocmd" => \$to_cmd,
+ "cc" => \@config_cc,
+ "cccmd" => \$cc_cmd,
++"headercmd" => \$header_cmd,
+ "aliasfiletype" => \$aliasfiletype,
+ "bcc" => \@config_bcc,
+ "suppresscc" => \@suppress_cc,
+@@ -519,6 +522,7 @@ sub config_regexp {
+   "compose" => \$compose,
+   "quiet" => \$quiet,
+   "cc-cmd=s" => \$cc_cmd,
++  "header-cmd=s" => \$header_cmd,
+   "suppress-from!" => \$suppress_from,
+   "no-suppress-from" => sub {$suppress_from = 0},
+   "suppress-cc=s" => \@suppress_cc,
+@@ -1776,6 +1780,9 @@ sub process_file {
+   push(@header, $_);
+   }
+   }
++  # Add computed headers, if applicable.
++  push @header,