]> git.ipfire.org Git - thirdparty/git.git/commit
format-patch: --rfc honors what --subject-prefix sets
authorDrew DeVault <sir@cmpwn.com>
Wed, 30 Aug 2023 06:43:33 +0000 (08:43 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 31 Aug 2023 22:02:21 +0000 (15:02 -0700)
commite0d7db7423a91673c001aaa5e580c815ce2f7f92
tree7faa26e68b1ac6271f837180c7cd989378599e40
parent5dc72c0fbcbccf7dbb42e470e55dafbd2afdf343
format-patch: --rfc honors what --subject-prefix sets

Rather than replacing the configured subject prefix (either through the
git config or command line) entirely with "RFC PATCH", this change
prepends RFC to whatever subject prefix was already in use.

This is useful, for example, when a user is working on a repository that
has a subject prefix considered to disambiguate patches:

git config format.subjectPrefix 'PATCH my-project'

Prior to this change, formatting patches with --rfc would lose the
'my-project' information.

The data flow for the subject-prefix was that rev.subject_prefix
were to be kept the authoritative version of the subject prefix even
while parsing command line options, and sprefix variable was used as
a temporary area to futz with it.  Now, the parsing code has been
refactored to build the subject prefix into the sprefix variable and
assigns its value at the end to rev.subject_prefix, which makes the
flow easier to grasp.

Signed-off-by: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-format-patch.txt
builtin/log.c
t/t4014-format-patch.sh