]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jc/format-patch-rfc-more'
authorJunio C Hamano <gitster@pobox.com>
Tue, 30 Apr 2024 21:49:42 +0000 (14:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Apr 2024 21:49:43 +0000 (14:49 -0700)
The "--rfc" option of "git format-patch" learned to take an
optional string value to be used in place of "RFC" to tweak the
"[PATCH]" on the subject header.

* jc/format-patch-rfc-more:
  format-patch: "--rfc=-(WIP)" appends to produce [PATCH (WIP)]
  format-patch: allow --rfc to optionally take a value, like --rfc=WIP

1  2 
builtin/log.c
t/t4014-format-patch.sh

diff --cc builtin/log.c
index 8bab30fcc70d5ba1efa92e72c36c826f02467d5b,4750e480e607251924b8a64dec228c55e8a4a4d4..4da73999053141ad51b866fec7387071c3ca9108
@@@ -2050,9 -2065,11 +2065,12 @@@ int cmd_format_patch(int argc, const ch
        if (cover_from_description_arg)
                cover_from_description_mode = parse_cover_from_description(cover_from_description_arg);
  
-       if (rfc) {
-               strbuf_insertstr(&sprefix, 0, "RFC ");
+       if (rfc && rfc[0]) {
 +              subject_prefix = 1;
+               if (rfc[0] == '-')
+                       strbuf_addf(&sprefix, " %s", rfc + 1);
+               else
+                       strbuf_insertf(&sprefix, 0, "%s ", rfc);
        }
  
        if (reroll_count) {
Simple merge