]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'dd/format-patch-rfc-updates'
authorJunio C Hamano <gitster@pobox.com>
Thu, 7 Sep 2023 22:06:08 +0000 (15:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Sep 2023 22:06:08 +0000 (15:06 -0700)
"git format-patch --rfc --subject-prefix=<foo>" used to ignore the
"--subject-prefix" option and used "[RFC PATCH]"; now we will add
"RFC" prefix to whatever subject prefix is specified.

This is a backward compatible change that may deserve a note.

* dd/format-patch-rfc-updates:
  format-patch: --rfc honors what --subject-prefix sets

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

index 8e515c7dbba1bf9d737d5b1fe56171c805796c57,62345ed7643d89b95effb1fa6abcdf0cda096341..711823a7f4ef9429e1e127ae3a1c376b6a48c233
@@@ -215,15 -215,17 +215,21 @@@ is greater than 100 bytes, then the mod
  If `<mode>` is `none`, both the cover letter subject and body will be
  populated with placeholder text.
  
 +--description-file=<file>::
 +      Use the contents of <file> instead of the branch's description
 +      for generating the cover letter.
 +
  --subject-prefix=<subject prefix>::
        Instead of the standard '[PATCH]' prefix in the subject
-       line, instead use '[<subject prefix>]'. This
-       allows for useful naming of a patch series, and can be
-       combined with the `--numbered` option.
+       line, instead use '[<subject prefix>]'. This can be used
+       to name a patch series, and can be combined with the
+       `--numbered` option.
+ +
+ The configuration variable `format.subjectPrefix` may also be used
+ to configure a subject prefix to apply to a given repository for
+ all patches. This is often useful on mailing lists which receive
+ patches for several repositories and can be used to disambiguate
+ the patches (with a value of e.g. "PATCH my-project").
  
  --filename-max-length=<n>::
        Instead of the standard 64 bytes, chomp the generated output
diff --cc builtin/log.c
index 87088077d9db46cd3d47a176228b411bce7d7721,75762b497d32162a46ff22ad88a87f393f063d05..195cd46cdc89397d0b3e10d4ebd7d27a333180bb
@@@ -1949,9 -1932,7 +1945,9 @@@ int cmd_format_patch(int argc, const ch
                OPT_STRING(0, "cover-from-description", &cover_from_description_arg,
                            N_("cover-from-description-mode"),
                            N_("generate parts of a cover letter based on a branch's description")),
-               OPT_CALLBACK_F(0, "subject-prefix", &rev, N_("prefix"),
 +              OPT_FILENAME(0, "description-file", &description_file,
 +                           N_("use branch description from file")),
+               OPT_CALLBACK_F(0, "subject-prefix", &sprefix, N_("prefix"),
                            N_("use [<prefix>] instead of [PATCH]"),
                            PARSE_OPT_NONEG, subject_prefix_callback),
                OPT_CALLBACK_F('o', "output-directory", &output_directory,
Simple merge