* [PATCH 0/2] format-patch: make boolean and mention in diff-options.adoc
@ 2026-02-18 20:26 kristofferhaugsbakk
2026-02-18 20:26 ` [PATCH 1/2] format-patch: make format.noprefix a boolean kristofferhaugsbakk
` (2 more replies)
0 siblings, 3 replies; 16+ messages in thread
From: kristofferhaugsbakk @ 2026-02-18 20:26 UTC (permalink / raw)
To: git; +Cc: Kristoffer Haugsbakk, peff
From: Kristoffer Haugsbakk <code@khaugsbakk.name>
See: https://lore.kernel.org/git/a9602602-5fea-40c0-a505-34133ed4d58c@app.fastmail.com/
Topic name: kh/format-noprefix-boolean
Topic summary: The config `format.noprefix` should act like a
boolean. But now it is active no matter what the value is. Change it to
act like a boolean like `diff.noprefix`. Also mention it instead of
`diff.noprefix` in git-format-patch(1) doc.
This is a breaking change. But I have opted to die if the config is not
a boolean and just hint about the change. See also Peff’s comment on
such a breaking change in that link.
I have also asked here about marking breaking changes:
https://lore.kernel.org/git/3124b359-2929-4f3f-9ac6-793277fe422b@jontes.page/T/#ma8856238748d0794a0da6c64e1c0c8a4824b996f
Kristoffer Haugsbakk (2):
format-patch: make format.noprefix a boolean
doc: diff-options.adoc: show format.noprefix for format-patch
Documentation/diff-options.adoc | 4 +++-
builtin/log.c | 13 ++++++++++++-
t/t4014-format-patch.sh | 16 ++++++++++++++++
3 files changed, 31 insertions(+), 2 deletions(-)
base-commit: 67ad42147a7acc2af6074753ebd03d904476118f
--
2.53.0.26.g2afa8602a26
^ permalink raw reply [flat|nested] 16+ messages in thread* [PATCH 1/2] format-patch: make format.noprefix a boolean 2026-02-18 20:26 [PATCH 0/2] format-patch: make boolean and mention in diff-options.adoc kristofferhaugsbakk @ 2026-02-18 20:26 ` kristofferhaugsbakk 2026-02-19 18:03 ` Junio C Hamano 2026-02-20 12:28 ` Jeff King 2026-02-18 20:26 ` [PATCH 2/2] doc: diff-options.adoc: show format.noprefix for format-patch kristofferhaugsbakk 2026-02-23 23:30 ` [PATCH v2 0/2] format-patch: make boolean and mention in diff-options.adoc kristofferhaugsbakk 2 siblings, 2 replies; 16+ messages in thread From: kristofferhaugsbakk @ 2026-02-18 20:26 UTC (permalink / raw) To: git; +Cc: Kristoffer Haugsbakk, peff From: Kristoffer Haugsbakk <code@khaugsbakk.name> The config `format.noprefix` was added in 8d5213de (format-patch: add format.noprefix option, 2023-03-09) to support no-prefix on paths. That was immediately after making git-format-patch(1) not respect `diff.noprefix`.[1] The intent was to mirror `diff.noprefix`. But this config was unintentionally[2] implemented by enabling no-prefix if any kind of value is set. † 1: c169af8f (format-patch: do not respect diff.noprefix, 2023-03-09) † 2: https://lore.kernel.org/all/20260211073553.GA1867915@coredump.intra.peff.net/ Let’s indeed mirror `diff.noprefix` by treating it as a boolean. This is a breaking change. And as far as breaking changes go it is pretty benign: • The documentation claims that this config is equivalent to `diff.noprefix`; this is just a bug fix if the documentation is what defines the application interface • Only users with non-boolean values will run into problems when we try to parse it as a boolean. But what would (1) make them suspect they could do that in the first place, and (2) have motivated them to do it? • Users who have set this to `false` and expect that to mean *enable format.noprefix* (current behavior) will now have the opposite experience. Which is not a reasonable setup. Let’s only offer a breaking change fig leaf by hinting about the previous behavior before dying. Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> --- builtin/log.c | 13 ++++++++++++- t/t4014-format-patch.sh | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/builtin/log.c b/builtin/log.c index 5c9a8ef3632..e56af7465ae 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1096,7 +1096,18 @@ static int git_format_config(const char *var, const char *value, return 0; } if (!strcmp(var, "format.noprefix")) { - format_no_prefix = 1; + format_no_prefix = git_parse_maybe_bool(value); + if (format_no_prefix < 0) { + int status = die_message( + _("bad boolean config value '%s' for '%s'"), + value, var); + fprintf(stderr, + _("hint: '%s' used to accept any value but " + "now only\n" + "hint: accepts boolean values, like '%s'\n"), + var, "diff.noprefix"); + exit(status); + } return 0; } diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 21d6d0cd9ef..645ac402a19 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -2541,10 +2541,26 @@ test_expect_success 'format-patch respects format.noprefix' ' grep "^--- blorp" actual ' +test_expect_success 'format.noprefix=false' ' + git -c format.noprefix=false format-patch -1 --stdout >actual && + grep "^--- a/blorp" actual +' + test_expect_success 'format-patch --default-prefix overrides format.noprefix' ' git -c format.noprefix \ format-patch -1 --default-prefix --stdout >actual && grep "^--- a/blorp" actual ' +test_expect_success 'errors on format.noprefix which is not boolean' ' + cat >expect <<-EOF && + fatal: bad boolean config value ${SQ}not-a-bool${SQ} for ${SQ}format.noprefix${SQ} + hint: ${SQ}format.noprefix${SQ} used to accept any value but now only + hint: accepts boolean values, like ${SQ}diff.noprefix${SQ} + EOF + test_must_fail git -c format.noprefix=not-a-bool \ + format-patch -1 --stdout 2>actual && + test_cmp expect actual +' + test_done -- 2.53.0.26.g2afa8602a26 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] format-patch: make format.noprefix a boolean 2026-02-18 20:26 ` [PATCH 1/2] format-patch: make format.noprefix a boolean kristofferhaugsbakk @ 2026-02-19 18:03 ` Junio C Hamano 2026-02-23 23:25 ` Kristoffer Haugsbakk 2026-02-20 12:28 ` Jeff King 1 sibling, 1 reply; 16+ messages in thread From: Junio C Hamano @ 2026-02-19 18:03 UTC (permalink / raw) To: kristofferhaugsbakk; +Cc: git, Kristoffer Haugsbakk, peff kristofferhaugsbakk@fastmail.com writes: > From: Kristoffer Haugsbakk <code@khaugsbakk.name> > > The config `format.noprefix` was added in 8d5213de (format-patch: add > format.noprefix option, 2023-03-09) to support no-prefix on paths. > That was immediately after making git-format-patch(1) not respect > `diff.noprefix`.[1] > > The intent was to mirror `diff.noprefix`. But this config was > unintentionally[2] implemented by enabling no-prefix if any kind of > value is set. > > † 1: c169af8f (format-patch: do not respect diff.noprefix, 2023-03-09) > † 2: https://lore.kernel.org/all/20260211073553.GA1867915@coredump.intra.peff.net/ > > Let’s indeed mirror `diff.noprefix` by treating it as a boolean. > > This is a breaking change. And as far as breaking changes go it is > pretty benign: > > • The documentation claims that this config is equivalent to > `diff.noprefix`; this is just a bug fix if the documentation is > what defines the application interface > • Only users with non-boolean values will run into problems when we > try to parse it as a boolean. But what would (1) make them suspect > they could do that in the first place, and (2) have motivated them to > do it? > • Users who have set this to `false` and expect that to mean *enable > format.noprefix* (current behavior) will now have the opposite > experience. Which is not a reasonable setup. > > Let’s only offer a breaking change fig leaf by hinting about the > previous behavior before dying. One case that is often problematic is what happens to those who use the same set of configuration variables with different versions of Git, before and after such behaviour change. But I do not think this is such a bad thing. The only reason why they had this variable set (to any value, or to a value-less true) with existing versions of Git is because they wanted to omit the prefixes, so when a new version of Git dies with "Heh, 'nothanks' is not a valid boolean value", they can edit the configuration variable to "1". And from that point of view, I think the hint given together with the "bad boolean" error can and should be phrased a bit more strongly, i.e., > + format_no_prefix = git_parse_maybe_bool(value); > + if (format_no_prefix < 0) { > + int status = die_message( > + _("bad boolean config value '%s' for '%s'"), > + value, var); > + fprintf(stderr, > + _("hint: '%s' used to accept any value but " > + "now only\n" > + "hint: accepts boolean values, like '%s'\n"), > + var, "diff.noprefix"); The target audience of this (hint) is those who have set this variable to a non-boolean strring from the existing version of Git, and the only thing they meant to express was "I do not want any prefix", so "we used to accept any value as true, but now accepts only valid boolean values", perhaps? That would nudge those who wrote "[format] noprefix = NoThanks" to rewrite it correctly to "true" or "1", and not "no". This is a related tangent, but shouldn't this use advise() without configuration? There is no need to allocate an advice_type and use advise_if_enabled(), because correcting a malformed configuration is an action enough to squelch the message. > + exit(status); > + } > return 0; > } ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] format-patch: make format.noprefix a boolean 2026-02-19 18:03 ` Junio C Hamano @ 2026-02-23 23:25 ` Kristoffer Haugsbakk 0 siblings, 0 replies; 16+ messages in thread From: Kristoffer Haugsbakk @ 2026-02-23 23:25 UTC (permalink / raw) To: Junio C Hamano, Kristoffer Haugsbakk; +Cc: git, Jeff King On Thu, Feb 19, 2026, at 19:03, Junio C Hamano wrote: >>[snip] >> Let’s only offer a breaking change fig leaf by hinting about the >> previous behavior before dying. > > One case that is often problematic is what happens to those who use > the same set of configuration variables with different versions of > Git, before and after such behaviour change. But I do not think > this is such a bad thing. The only reason why they had this > variable set (to any value, or to a value-less true) with existing > versions of Git is because they wanted to omit the prefixes, so when > a new version of Git dies with "Heh, 'nothanks' is not a valid > boolean value", they can edit the configuration variable to "1". Yeah. I like how this was handled for `core.commentString`: You can set both `core.commentChar` and the new config and still be able to run on old versions. > And from that point of view, I think the hint given together with > the "bad boolean" error can and should be phrased a bit more > strongly, i.e., > >> + format_no_prefix = git_parse_maybe_bool(value); >> + if (format_no_prefix < 0) { >> + int status = die_message( >> + _("bad boolean config value '%s' for '%s'"), >> + value, var); >> + fprintf(stderr, >> + _("hint: '%s' used to accept any value but " >> + "now only\n" >> + "hint: accepts boolean values, like '%s'\n"), >> + var, "diff.noprefix"); > > The target audience of this (hint) is those who have set this > variable to a non-boolean strring from the existing version of Git, > and the only thing they meant to express was "I do not want any > prefix", so "we used to accept any value as true, but now accepts > only valid boolean values", perhaps? That would nudge those who > wrote "[format] noprefix = NoThanks" to rewrite it correctly to > "true" or "1", and not "no". Very true. I’ll change to spell out that any value used to be treated as `true`. Right now it just says “used to accept any value”. But not what it means to accept any value... > This is a related tangent, but shouldn't this use advise() without > configuration? There is no need to allocate an advice_type and use > advise_if_enabled(), because correcting a malformed configuration is > an action enough to squelch the message. Oh, right. That fits well here. In hindsight I think I should have used that in 5a312527 (whatchanged: hint about git-log(1) and aliasing, 2025-09-17). ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] format-patch: make format.noprefix a boolean 2026-02-18 20:26 ` [PATCH 1/2] format-patch: make format.noprefix a boolean kristofferhaugsbakk 2026-02-19 18:03 ` Junio C Hamano @ 2026-02-20 12:28 ` Jeff King 1 sibling, 0 replies; 16+ messages in thread From: Jeff King @ 2026-02-20 12:28 UTC (permalink / raw) To: kristofferhaugsbakk; +Cc: git, Kristoffer Haugsbakk On Wed, Feb 18, 2026 at 09:26:17PM +0100, kristofferhaugsbakk@fastmail.com wrote: > This is a breaking change. And as far as breaking changes go it is > pretty benign: > > • The documentation claims that this config is equivalent to > `diff.noprefix`; this is just a bug fix if the documentation is > what defines the application interface > • Only users with non-boolean values will run into problems when we > try to parse it as a boolean. But what would (1) make them suspect > they could do that in the first place, and (2) have motivated them to > do it? > • Users who have set this to `false` and expect that to mean *enable > format.noprefix* (current behavior) will now have the opposite > experience. Which is not a reasonable setup. > > Let’s only offer a breaking change fig leaf by hinting about the > previous behavior before dying. Thanks for following through with this. I probably would not have bothered with even the fig leaf, and just considered it a bug fix. But since you bothered to write it, I don't object. -Peff ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/2] doc: diff-options.adoc: show format.noprefix for format-patch 2026-02-18 20:26 [PATCH 0/2] format-patch: make boolean and mention in diff-options.adoc kristofferhaugsbakk 2026-02-18 20:26 ` [PATCH 1/2] format-patch: make format.noprefix a boolean kristofferhaugsbakk @ 2026-02-18 20:26 ` kristofferhaugsbakk 2026-02-19 18:10 ` Junio C Hamano 2026-02-23 23:30 ` [PATCH v2 0/2] format-patch: make boolean and mention in diff-options.adoc kristofferhaugsbakk 2 siblings, 1 reply; 16+ messages in thread From: kristofferhaugsbakk @ 2026-02-18 20:26 UTC (permalink / raw) To: git; +Cc: Kristoffer Haugsbakk, peff From: Kristoffer Haugsbakk <code@khaugsbakk.name> git-format-patch(1) uses `format.noprefix` and ignores `diff.noprefix`. The configuration variable `format.prefix` was added as an “escape hatch” because “it’s unlikely that anybody really wants format. noprefix=true in the first place.”[1] Based on that there doesn’t seem to be a need to widely advertise this configuration variable. But in any case: the documentation for this option should not claim that it overrides a config that is always ignored. † 1: 8d5213de (format-patch: add format.noprefix option, 2023-03-09) Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> --- Notes (series): `--default-prefix` does override `format.noprefix`. See test `format-patch --default-prefix overrides format.noprefix`. Documentation/diff-options.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc index 9cdad6f72a0..8f632d5fe1a 100644 --- a/Documentation/diff-options.adoc +++ b/Documentation/diff-options.adoc @@ -860,7 +860,9 @@ endif::git-format-patch[] `--default-prefix`:: Use the default source and destination prefixes ("a/" and "b/"). - This overrides configuration variables such as `diff.noprefix`, + This overrides configuration variables such as +ifndef::git-format-patch[`diff.noprefix`,] +ifdef::git-format-patch[`format.noprefix`,] `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` (see linkgit:git-config[1]). -- 2.53.0.26.g2afa8602a26 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 2/2] doc: diff-options.adoc: show format.noprefix for format-patch 2026-02-18 20:26 ` [PATCH 2/2] doc: diff-options.adoc: show format.noprefix for format-patch kristofferhaugsbakk @ 2026-02-19 18:10 ` Junio C Hamano 0 siblings, 0 replies; 16+ messages in thread From: Junio C Hamano @ 2026-02-19 18:10 UTC (permalink / raw) To: kristofferhaugsbakk; +Cc: git, Kristoffer Haugsbakk, peff kristofferhaugsbakk@fastmail.com writes: > From: Kristoffer Haugsbakk <code@khaugsbakk.name> > > git-format-patch(1) uses `format.noprefix` and ignores `diff.noprefix`. > > The configuration variable `format.prefix` was added as an “escape > hatch” because “it’s unlikely that anybody really wants format. > noprefix=true in the first place.”[1] Based on that there doesn’t > seem to be a need to widely advertise this configuration variable. > > But in any case: the documentation for this option should not claim > that it overrides a config that is always ignored. > > † 1: 8d5213de (format-patch: add format.noprefix option, 2023-03-09) > > Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> > --- > > Notes (series): > `--default-prefix` does override `format.noprefix`. See test `format-patch > --default-prefix overrides format.noprefix`. > > Documentation/diff-options.adoc | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc > index 9cdad6f72a0..8f632d5fe1a 100644 > --- a/Documentation/diff-options.adoc > +++ b/Documentation/diff-options.adoc > @@ -860,7 +860,9 @@ endif::git-format-patch[] > > `--default-prefix`:: > Use the default source and destination prefixes ("a/" and "b/"). > - This overrides configuration variables such as `diff.noprefix`, > + This overrides configuration variables such as > +ifndef::git-format-patch[`diff.noprefix`,] > +ifdef::git-format-patch[`format.noprefix`,] > `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` > (see linkgit:git-config[1]). The reasoning makes sense. The ifn?def::*[<something>] syntax is new to our documentation set, but we'll see soon enough how AsciiDoc and Asciidoctor renders them. Queued. Thanks. ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 0/2] format-patch: make boolean and mention in diff-options.adoc 2026-02-18 20:26 [PATCH 0/2] format-patch: make boolean and mention in diff-options.adoc kristofferhaugsbakk 2026-02-18 20:26 ` [PATCH 1/2] format-patch: make format.noprefix a boolean kristofferhaugsbakk 2026-02-18 20:26 ` [PATCH 2/2] doc: diff-options.adoc: show format.noprefix for format-patch kristofferhaugsbakk @ 2026-02-23 23:30 ` kristofferhaugsbakk 2026-02-23 23:30 ` [PATCH v2 1/2] format-patch: make format.noprefix a boolean kristofferhaugsbakk 2026-02-23 23:30 ` [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch kristofferhaugsbakk 2 siblings, 2 replies; 16+ messages in thread From: kristofferhaugsbakk @ 2026-02-23 23:30 UTC (permalink / raw) To: git; +Cc: Kristoffer Haugsbakk, Jeff King From: Kristoffer Haugsbakk <code@khaugsbakk.name> See: https://lore.kernel.org/git/a9602602-5fea-40c0-a505-34133ed4d58c@app.fastmail.com/ Topic name (applied): kh/format-patch-noprefix-is-boolean Topic summary: The config `format.noprefix` should act like a boolean. But now it is active no matter what the value is. Change it to act like a boolean like `diff.noprefix`. Also mention it instead of `diff.noprefix` in git-format-patch(1) doc. § Changes in v2 Got feedback from Junio. Copied from note on Patch 1/2: • Use `advise()` for the hint; you get the `hint:` prefix and color • Rework the hint, or the advise, to say that any value *used to be* treated as `true`. That better helps people who maybe set `nope` when they meant, “no, I don’t want any prefix” (for example) Also a commit message tweak on Patch 2/2. § Link to v1 https://lore.kernel.org/git/CV_format.noprefix_boolean.39c@msgid.xyz/ § Breaking change (unchanged since v1) This is a breaking change. But I have opted to die if the config is not a boolean and just hint about the change. See also Peff’s comment on such a breaking change in that link. I have also asked here about marking breaking changes: https://lore.kernel.org/git/3124b359-2929-4f3f-9ac6-793277fe422b@jontes.page/T/#ma8856238748d0794a0da6c64e1c0c8a4824b996f Kristoffer Haugsbakk (2): format-patch: make format.noprefix a boolean doc: diff-options.adoc: show format.noprefix for format-patch Documentation/diff-options.adoc | 4 +++- builtin/log.c | 14 +++++++++++++- t/t4014-format-patch.sh | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) Interdiff against v1: diff --git a/builtin/log.c b/builtin/log.c index e56af7465ae..275122b807e 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -40,6 +40,7 @@ #include "mailmap.h" #include "progress.h" #include "commit-slab.h" +#include "advice.h" #include "commit-reach.h" #include "range-diff.h" @@ -1101,11 +1102,11 @@ static int git_format_config(const char *var, const char *value, int status = die_message( _("bad boolean config value '%s' for '%s'"), value, var); - fprintf(stderr, - _("hint: '%s' used to accept any value but " - "now only\n" - "hint: accepts boolean values, like '%s'\n"), - var, "diff.noprefix"); + advise(_("'%s' used to accept any value and " + "treat that as 'true'.\n" + "Now it only accepts boolean values, " + "like what '%s' does.\n"), + var, "diff.noprefix"); exit(status); } return 0; diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 645ac402a19..c20091e36fe 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -2555,8 +2555,8 @@ test_expect_success 'format-patch --default-prefix overrides format.noprefix' ' test_expect_success 'errors on format.noprefix which is not boolean' ' cat >expect <<-EOF && fatal: bad boolean config value ${SQ}not-a-bool${SQ} for ${SQ}format.noprefix${SQ} - hint: ${SQ}format.noprefix${SQ} used to accept any value but now only - hint: accepts boolean values, like ${SQ}diff.noprefix${SQ} + hint: ${SQ}format.noprefix${SQ} used to accept any value and treat that as ${SQ}true${SQ}. + hint: Now it only accepts boolean values, like what ${SQ}diff.noprefix${SQ} does. EOF test_must_fail git -c format.noprefix=not-a-bool \ format-patch -1 --stdout 2>actual && Range-diff against v1: 1: 49fa161a392 ! 1: eee61561eb3 format-patch: make format.noprefix a boolean @@ Commit message format.noprefix* (current behavior) will now have the opposite experience. Which is not a reasonable setup. - Let’s only offer a breaking change fig leaf by hinting about the + Let’s only offer a breaking change fig leaf by advising about the previous behavior before dying. Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> ## builtin/log.c ## +@@ + #include "mailmap.h" + #include "progress.h" + #include "commit-slab.h" ++#include "advice.h" + + #include "commit-reach.h" + #include "range-diff.h" @@ builtin/log.c: static int git_format_config(const char *var, const char *value, return 0; } @@ builtin/log.c: static int git_format_config(const char *var, const char *value, + int status = die_message( + _("bad boolean config value '%s' for '%s'"), + value, var); -+ fprintf(stderr, -+ _("hint: '%s' used to accept any value but " -+ "now only\n" -+ "hint: accepts boolean values, like '%s'\n"), -+ var, "diff.noprefix"); ++ advise(_("'%s' used to accept any value and " ++ "treat that as 'true'.\n" ++ "Now it only accepts boolean values, " ++ "like what '%s' does.\n"), ++ var, "diff.noprefix"); + exit(status); + } return 0; @@ t/t4014-format-patch.sh: test_expect_success 'format-patch respects format.nopre +test_expect_success 'errors on format.noprefix which is not boolean' ' + cat >expect <<-EOF && + fatal: bad boolean config value ${SQ}not-a-bool${SQ} for ${SQ}format.noprefix${SQ} -+ hint: ${SQ}format.noprefix${SQ} used to accept any value but now only -+ hint: accepts boolean values, like ${SQ}diff.noprefix${SQ} ++ hint: ${SQ}format.noprefix${SQ} used to accept any value and treat that as ${SQ}true${SQ}. ++ hint: Now it only accepts boolean values, like what ${SQ}diff.noprefix${SQ} does. + EOF + test_must_fail git -c format.noprefix=not-a-bool \ + format-patch -1 --stdout 2>actual && 2: 0cef1915a9c ! 2: b9b583bd007 doc: diff-options.adoc: show format.noprefix for format-patch @@ Commit message git-format-patch(1) uses `format.noprefix` and ignores `diff.noprefix`. The configuration variable `format.prefix` was added as an “escape - hatch” because “it’s unlikely that anybody really wants format. + hatch”, and “it’s unlikely that anybody really wants format. noprefix=true in the first place.”[1] Based on that there doesn’t seem to be a need to widely advertise this configuration variable. base-commit: 67ad42147a7acc2af6074753ebd03d904476118f -- 2.53.0.26.g2afa8602a26 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 1/2] format-patch: make format.noprefix a boolean 2026-02-23 23:30 ` [PATCH v2 0/2] format-patch: make boolean and mention in diff-options.adoc kristofferhaugsbakk @ 2026-02-23 23:30 ` kristofferhaugsbakk 2026-02-23 23:30 ` [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch kristofferhaugsbakk 1 sibling, 0 replies; 16+ messages in thread From: kristofferhaugsbakk @ 2026-02-23 23:30 UTC (permalink / raw) To: git; +Cc: Kristoffer Haugsbakk, Jeff King From: Kristoffer Haugsbakk <code@khaugsbakk.name> The config `format.noprefix` was added in 8d5213de (format-patch: add format.noprefix option, 2023-03-09) to support no-prefix on paths. That was immediately after making git-format-patch(1) not respect `diff.noprefix`.[1] The intent was to mirror `diff.noprefix`. But this config was unintentionally[2] implemented by enabling no-prefix if any kind of value is set. † 1: c169af8f (format-patch: do not respect diff.noprefix, 2023-03-09) † 2: https://lore.kernel.org/all/20260211073553.GA1867915@coredump.intra.peff.net/ Let’s indeed mirror `diff.noprefix` by treating it as a boolean. This is a breaking change. And as far as breaking changes go it is pretty benign: • The documentation claims that this config is equivalent to `diff.noprefix`; this is just a bug fix if the documentation is what defines the application interface • Only users with non-boolean values will run into problems when we try to parse it as a boolean. But what would (1) make them suspect they could do that in the first place, and (2) have motivated them to do it? • Users who have set this to `false` and expect that to mean *enable format.noprefix* (current behavior) will now have the opposite experience. Which is not a reasonable setup. Let’s only offer a breaking change fig leaf by advising about the previous behavior before dying. Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> --- Notes (series): v2: • Use `advise()` for the hint; you get the `hint:` prefix and color • Rework the hint, or the advise, to say that any value *used to be* treated as `true`. That better helps people who maybe set `nope` when they meant, “no, I don’t want any prefix” (for example) builtin/log.c | 14 +++++++++++++- t/t4014-format-patch.sh | 16 ++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/builtin/log.c b/builtin/log.c index 5c9a8ef3632..275122b807e 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -40,6 +40,7 @@ #include "mailmap.h" #include "progress.h" #include "commit-slab.h" +#include "advice.h" #include "commit-reach.h" #include "range-diff.h" @@ -1096,7 +1097,18 @@ static int git_format_config(const char *var, const char *value, return 0; } if (!strcmp(var, "format.noprefix")) { - format_no_prefix = 1; + format_no_prefix = git_parse_maybe_bool(value); + if (format_no_prefix < 0) { + int status = die_message( + _("bad boolean config value '%s' for '%s'"), + value, var); + advise(_("'%s' used to accept any value and " + "treat that as 'true'.\n" + "Now it only accepts boolean values, " + "like what '%s' does.\n"), + var, "diff.noprefix"); + exit(status); + } return 0; } diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 21d6d0cd9ef..c20091e36fe 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -2541,10 +2541,26 @@ test_expect_success 'format-patch respects format.noprefix' ' grep "^--- blorp" actual ' +test_expect_success 'format.noprefix=false' ' + git -c format.noprefix=false format-patch -1 --stdout >actual && + grep "^--- a/blorp" actual +' + test_expect_success 'format-patch --default-prefix overrides format.noprefix' ' git -c format.noprefix \ format-patch -1 --default-prefix --stdout >actual && grep "^--- a/blorp" actual ' +test_expect_success 'errors on format.noprefix which is not boolean' ' + cat >expect <<-EOF && + fatal: bad boolean config value ${SQ}not-a-bool${SQ} for ${SQ}format.noprefix${SQ} + hint: ${SQ}format.noprefix${SQ} used to accept any value and treat that as ${SQ}true${SQ}. + hint: Now it only accepts boolean values, like what ${SQ}diff.noprefix${SQ} does. + EOF + test_must_fail git -c format.noprefix=not-a-bool \ + format-patch -1 --stdout 2>actual && + test_cmp expect actual +' + test_done -- 2.53.0.26.g2afa8602a26 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch 2026-02-23 23:30 ` [PATCH v2 0/2] format-patch: make boolean and mention in diff-options.adoc kristofferhaugsbakk 2026-02-23 23:30 ` [PATCH v2 1/2] format-patch: make format.noprefix a boolean kristofferhaugsbakk @ 2026-02-23 23:30 ` kristofferhaugsbakk 2026-02-27 9:57 ` Jean-Noël Avila 1 sibling, 1 reply; 16+ messages in thread From: kristofferhaugsbakk @ 2026-02-23 23:30 UTC (permalink / raw) To: git; +Cc: Kristoffer Haugsbakk, Jeff King From: Kristoffer Haugsbakk <code@khaugsbakk.name> git-format-patch(1) uses `format.noprefix` and ignores `diff.noprefix`. The configuration variable `format.prefix` was added as an “escape hatch”, and “it’s unlikely that anybody really wants format. noprefix=true in the first place.”[1] Based on that there doesn’t seem to be a need to widely advertise this configuration variable. But in any case: the documentation for this option should not claim that it overrides a config that is always ignored. † 1: 8d5213de (format-patch: add format.noprefix option, 2023-03-09) Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> --- Notes (series): v2: Change commit message. Don’t use “because”: the two quotes are not causally linked like that. v1: `--default-prefix` does override `format.noprefix`. See test `format-patch --default-prefix overrides format.noprefix`. Documentation/diff-options.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc index 9cdad6f72a0..8f632d5fe1a 100644 --- a/Documentation/diff-options.adoc +++ b/Documentation/diff-options.adoc @@ -860,7 +860,9 @@ endif::git-format-patch[] `--default-prefix`:: Use the default source and destination prefixes ("a/" and "b/"). - This overrides configuration variables such as `diff.noprefix`, + This overrides configuration variables such as +ifndef::git-format-patch[`diff.noprefix`,] +ifdef::git-format-patch[`format.noprefix`,] `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` (see linkgit:git-config[1]). -- 2.53.0.26.g2afa8602a26 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch 2026-02-23 23:30 ` [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch kristofferhaugsbakk @ 2026-02-27 9:57 ` Jean-Noël Avila 2026-02-27 16:51 ` Junio C Hamano 2026-02-28 12:20 ` kristofferhaugsbakk 0 siblings, 2 replies; 16+ messages in thread From: Jean-Noël Avila @ 2026-02-27 9:57 UTC (permalink / raw) To: kristofferhaugsbakk, git; +Cc: Kristoffer Haugsbakk, Jeff King Le 24/02/2026 à 00:30, kristofferhaugsbakk@fastmail.com a écrit : > From: Kristoffer Haugsbakk <code@khaugsbakk.name> > > git-format-patch(1) uses `format.noprefix` and ignores `diff.noprefix`. > > The configuration variable `format.prefix` was added as an “escape > hatch”, and “it’s unlikely that anybody really wants format. > noprefix=true in the first place.”[1] Based on that there doesn’t > seem to be a need to widely advertise this configuration variable. > > But in any case: the documentation for this option should not claim > that it overrides a config that is always ignored. > > † 1: 8d5213de (format-patch: add format.noprefix option, 2023-03-09) > > Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> > --- > > Notes (series): > v2: > Change commit message. Don’t use “because”: the two quotes are not causally > linked like that. > > v1: > `--default-prefix` does override `format.noprefix`. See test `format-patch > --default-prefix overrides format.noprefix`. > > Documentation/diff-options.adoc | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc > index 9cdad6f72a0..8f632d5fe1a 100644 > --- a/Documentation/diff-options.adoc > +++ b/Documentation/diff-options.adoc > @@ -860,7 +860,9 @@ endif::git-format-patch[] > > `--default-prefix`:: > Use the default source and destination prefixes ("a/" and "b/"). > - This overrides configuration variables such as `diff.noprefix`, > + This overrides configuration variables such as > +ifndef::git-format-patch[`diff.noprefix`,] > +ifdef::git-format-patch[`format.noprefix`,] > `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` > (see linkgit:git-config[1]). > Hello, This kind of sentence assembly does not fit well with translations. Each hunk of the sentence is processed separately and it is a difficulty for translators as they need to understand the surrounding context of a segment when translating it. It is safer to just write the whole paragraph, or at least a sentence in the ifdef/ifndef sections. Thanks ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch 2026-02-27 9:57 ` Jean-Noël Avila @ 2026-02-27 16:51 ` Junio C Hamano 2026-02-28 12:20 ` kristofferhaugsbakk 1 sibling, 0 replies; 16+ messages in thread From: Junio C Hamano @ 2026-02-27 16:51 UTC (permalink / raw) To: Jean-Noël Avila Cc: kristofferhaugsbakk, git, Kristoffer Haugsbakk, Jeff King Jean-Noël Avila <jn.avila@free.fr> writes: >> `--default-prefix`:: >> Use the default source and destination prefixes ("a/" and "b/"). >> - This overrides configuration variables such as `diff.noprefix`, >> + This overrides configuration variables such as >> +ifndef::git-format-patch[`diff.noprefix`,] >> +ifdef::git-format-patch[`format.noprefix`,] >> `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` >> (see linkgit:git-config[1]). >> > > Hello, > > This kind of sentence assembly does not fit well with translations. Each > hunk of the sentence is processed separately and it is a difficulty for > translators as they need to understand the surrounding context of a > segment when translating it. > > It is safer to just write the whole paragraph, or at least a sentence in > the ifdef/ifndef sections. Thanks, this particular patch in question is already in 'next', though. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch 2026-02-27 9:57 ` Jean-Noël Avila 2026-02-27 16:51 ` Junio C Hamano @ 2026-02-28 12:20 ` kristofferhaugsbakk 2026-02-28 14:08 ` Jean-Noël AVILA 2026-03-01 19:21 ` [PATCH v2] doc: diff-options.adoc: make *.noprefix split translatable kristofferhaugsbakk 1 sibling, 2 replies; 16+ messages in thread From: kristofferhaugsbakk @ 2026-02-28 12:20 UTC (permalink / raw) To: git, jn.avila; +Cc: Kristoffer Haugsbakk, kristofferhaugsbakk, gitster, peff From: Kristoffer Haugsbakk <code@khaugsbakk.name> On Fri, Feb 27, 2026, at 10:57, Jean-Noël Avila wrote: > Le 24/02/2026 à 00:30, kristofferhaugsbakk@fastmail.com a écrit : >> From: Kristoffer Haugsbakk <code@khaugsbakk.name> >>[snip] >> `--default-prefix`:: >> Use the default source and destination prefixes ("a/" and "b/"). >> - This overrides configuration variables such as `diff.noprefix`, >> + This overrides configuration variables such as >> +ifndef::git-format-patch[`diff.noprefix`,] >> +ifdef::git-format-patch[`format.noprefix`,] >> `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` >> (see linkgit:git-config[1]). >> > > Hello, > > This kind of sentence assembly does not fit well with translations. Each > hunk of the sentence is processed separately and it is a difficulty for > translators as they need to understand the surrounding context of a > segment when translating it. > > It is safer to just write the whole paragraph, or at least a sentence in > the ifdef/ifndef sections. Thanks for bringing this up. I have never taken doc translations into consideration. Would the following be the correct approach? -- 8< -- From: Kristoffer Haugsbakk <code@khaugsbakk.name> Subject: [PATCH] doc: diff-options.adoc: make *.noprefix split translatable We cannot split single words like what we did in the previous commit. That is because the doc translations are processed in bigger chunks. Instead write the two paragraphs with the only variations being this configuration variable. It’s not easy to spot the difference here. So let’s leave a comment for translators. Reported-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> --- Documentation/diff-options.adoc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc index 8f632d5fe1a..e4d02cc93a9 100644 --- a/Documentation/diff-options.adoc +++ b/Documentation/diff-options.adoc @@ -859,12 +859,19 @@ endif::git-format-patch[] Do not show any source or destination prefix. `--default-prefix`:: +// TRANSLATORS: format.noprefix / diff.noprefix +ifdef::git-format-patch[] Use the default source and destination prefixes ("a/" and "b/"). - This overrides configuration variables such as -ifndef::git-format-patch[`diff.noprefix`,] -ifdef::git-format-patch[`format.noprefix`,] + This overrides configuration variables such as `format.noprefix`, `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` (see linkgit:git-config[1]). +endif::git-format-patch[] +ifndef::git-format-patch[] + Use the default source and destination prefixes ("a/" and "b/"). + This overrides configuration variables such as `diff.noprefix`, + `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` + (see linkgit:git-config[1]). +ifndef::git-format-patch[] `--line-prefix=<prefix>`:: Prepend an additional _<prefix>_ to every line of output. base-commit: b9b583bd007ca814ebd362bdd6441aac02e9414b -- 2.53.0.26.g2afa8602a26 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch 2026-02-28 12:20 ` kristofferhaugsbakk @ 2026-02-28 14:08 ` Jean-Noël AVILA 2026-03-01 19:21 ` [PATCH v2] doc: diff-options.adoc: make *.noprefix split translatable kristofferhaugsbakk 1 sibling, 0 replies; 16+ messages in thread From: Jean-Noël AVILA @ 2026-02-28 14:08 UTC (permalink / raw) To: git, kristofferhaugsbakk Cc: Kristoffer Haugsbakk, kristofferhaugsbakk, gitster, peff On Saturday, 28 February 2026 13:20:33 CET kristofferhaugsbakk@fastmail.com wrote: > From: Kristoffer Haugsbakk <code@khaugsbakk.name> > > On Fri, Feb 27, 2026, at 10:57, Jean-Noël Avila wrote: > > Le 24/02/2026 à 00:30, kristofferhaugsbakk@fastmail.com a écrit : > >> From: Kristoffer Haugsbakk <code@khaugsbakk.name> > >> > >>[snip] > >> > >> `--default-prefix`:: > >> Use the default source and destination prefixes ("a/" and "b/"). > >> > >> - This overrides configuration variables such as `diff.noprefix`, > >> + This overrides configuration variables such as > >> +ifndef::git-format-patch[`diff.noprefix`,] > >> +ifdef::git-format-patch[`format.noprefix`,] > >> > >> `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` > >> (see linkgit:git-config[1]). > > > > Hello, > > > > This kind of sentence assembly does not fit well with translations. Each > > hunk of the sentence is processed separately and it is a difficulty for > > translators as they need to understand the surrounding context of a > > segment when translating it. > > > > It is safer to just write the whole paragraph, or at least a sentence in > > the ifdef/ifndef sections. > > Thanks for bringing this up. I have never taken doc translations into > consideration. > > Would the following be the correct approach? > > -- 8< -- > From: Kristoffer Haugsbakk <code@khaugsbakk.name> > Subject: [PATCH] doc: diff-options.adoc: make *.noprefix split translatable > > We cannot split single words like what we did in the previous > commit. That is because the doc translations are processed in > bigger chunks. > > Instead write the two paragraphs with the only variations being this > configuration variable. > > It’s not easy to spot the difference here. So let’s leave a comment > for translators. > > Reported-by: Jean-Noël Avila <jn.avila@free.fr> > Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> > --- > Documentation/diff-options.adoc | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/Documentation/diff-options.adoc b/Documentation/diff- options.adoc > index 8f632d5fe1a..e4d02cc93a9 100644 > --- a/Documentation/diff-options.adoc > +++ b/Documentation/diff-options.adoc > @@ -859,12 +859,19 @@ endif::git-format-patch[] > Do not show any source or destination prefix. > > `--default-prefix`:: > +// TRANSLATORS: format.noprefix / diff.noprefix > +ifdef::git-format-patch[] > Use the default source and destination prefixes ("a/" and "b/"). > - This overrides configuration variables such as > -ifndef::git-format-patch[`diff.noprefix`,] > -ifdef::git-format-patch[`format.noprefix`,] > + This overrides configuration variables such as `format.noprefix`, > `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` > (see linkgit:git-config[1]). > +endif::git-format-patch[] > +ifndef::git-format-patch[] > + Use the default source and destination prefixes ("a/" and "b/"). > + This overrides configuration variables such as `diff.noprefix`, > + `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` > + (see linkgit:git-config[1]). > +ifndef::git-format-patch[] I think this line should read : endif::git-format-patch[] I also don't quite understand the addition of the // TRANSLATORS: part. This is not needed as each paragraph will be translated as a standalone segment. Otherwise, this format of conditional text is fit for translation. Thanks ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2] doc: diff-options.adoc: make *.noprefix split translatable 2026-02-28 12:20 ` kristofferhaugsbakk 2026-02-28 14:08 ` Jean-Noël AVILA @ 2026-03-01 19:21 ` kristofferhaugsbakk 2026-03-02 16:53 ` Junio C Hamano 1 sibling, 1 reply; 16+ messages in thread From: kristofferhaugsbakk @ 2026-03-01 19:21 UTC (permalink / raw) To: git; +Cc: Kristoffer Haugsbakk, gitster, jn.avila, peff From: Kristoffer Haugsbakk <code@khaugsbakk.name> We cannot split single words like what we did in the previous commit. That is because the doc translations are processed in bigger chunks. Instead write the two paragraphs with the only variations being this configuration variable. Reported-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> --- Notes (series): Notes to the maintainer: based on topic kh/format-patch-noprefix-is-boolean to fix the issue reported in <ff86f877-4b75-403d-a5a4-10ab528a9691@free.fr> v2: • fix `endif` • Don’t use `TRANSLATORS` callout Documentation/diff-options.adoc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc index 8f632d5fe1a..fcfcdf0286e 100644 --- a/Documentation/diff-options.adoc +++ b/Documentation/diff-options.adoc @@ -859,12 +859,18 @@ endif::git-format-patch[] Do not show any source or destination prefix. `--default-prefix`:: +ifdef::git-format-patch[] Use the default source and destination prefixes ("a/" and "b/"). - This overrides configuration variables such as -ifndef::git-format-patch[`diff.noprefix`,] -ifdef::git-format-patch[`format.noprefix`,] + This overrides configuration variables such as `format.noprefix`, `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` (see linkgit:git-config[1]). +endif::git-format-patch[] +ifndef::git-format-patch[] + Use the default source and destination prefixes ("a/" and "b/"). + This overrides configuration variables such as `diff.noprefix`, + `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` + (see linkgit:git-config[1]). +endif::git-format-patch[] `--line-prefix=<prefix>`:: Prepend an additional _<prefix>_ to every line of output. Interdiff against v1: diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc index e4d02cc93a9..fcfcdf0286e 100644 --- a/Documentation/diff-options.adoc +++ b/Documentation/diff-options.adoc @@ -859,7 +859,6 @@ endif::git-format-patch[] Do not show any source or destination prefix. `--default-prefix`:: -// TRANSLATORS: format.noprefix / diff.noprefix ifdef::git-format-patch[] Use the default source and destination prefixes ("a/" and "b/"). This overrides configuration variables such as `format.noprefix`, @@ -871,7 +870,7 @@ ifndef::git-format-patch[] This overrides configuration variables such as `diff.noprefix`, `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` (see linkgit:git-config[1]). -ifndef::git-format-patch[] +endif::git-format-patch[] `--line-prefix=<prefix>`:: Prepend an additional _<prefix>_ to every line of output. Range-diff against v1: 1: 55e56c90959 ! 1: 07acc52c3bc doc: diff-options.adoc: make *.noprefix split translatable @@ Commit message Instead write the two paragraphs with the only variations being this configuration variable. - It’s not easy to spot the difference here. So let’s leave a comment - for translators. - Reported-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> + + ## Notes (series) ## + Notes to the maintainer: based on topic kh/format-patch-noprefix-is-boolean + to fix the issue reported in <ff86f877-4b75-403d-a5a4-10ab528a9691@free.fr> + + v2: + • fix `endif` + • Don’t use `TRANSLATORS` callout + ## Documentation/diff-options.adoc ## @@ Documentation/diff-options.adoc: endif::git-format-patch[] Do not show any source or destination prefix. `--default-prefix`:: -+// TRANSLATORS: format.noprefix / diff.noprefix +ifdef::git-format-patch[] Use the default source and destination prefixes ("a/" and "b/"). - This overrides configuration variables such as @@ Documentation/diff-options.adoc: endif::git-format-patch[] + This overrides configuration variables such as `diff.noprefix`, + `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` + (see linkgit:git-config[1]). -+ifndef::git-format-patch[] ++endif::git-format-patch[] `--line-prefix=<prefix>`:: Prepend an additional _<prefix>_ to every line of output. base-commit: b9b583bd007ca814ebd362bdd6441aac02e9414b -- 2.53.0.26.g2afa8602a26 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2] doc: diff-options.adoc: make *.noprefix split translatable 2026-03-01 19:21 ` [PATCH v2] doc: diff-options.adoc: make *.noprefix split translatable kristofferhaugsbakk @ 2026-03-02 16:53 ` Junio C Hamano 0 siblings, 0 replies; 16+ messages in thread From: Junio C Hamano @ 2026-03-02 16:53 UTC (permalink / raw) To: kristofferhaugsbakk; +Cc: git, Kristoffer Haugsbakk, jn.avila, peff kristofferhaugsbakk@fastmail.com writes: > From: Kristoffer Haugsbakk <code@khaugsbakk.name> > > We cannot split single words like what we did in the previous > commit. That is because the doc translations are processed in > bigger chunks. > > Instead write the two paragraphs with the only variations being this > configuration variable. > > Reported-by: Jean-Noël Avila <jn.avila@free.fr> > Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> > --- > > Notes (series): > Notes to the maintainer: based on topic kh/format-patch-noprefix-is-boolean > to fix the issue reported in <ff86f877-4b75-403d-a5a4-10ab528a9691@free.fr> > > v2: > • fix `endif` > • Don’t use `TRANSLATORS` callout Thanks. Looking good. Will queue on top. > Documentation/diff-options.adoc | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc > index 8f632d5fe1a..fcfcdf0286e 100644 > --- a/Documentation/diff-options.adoc > +++ b/Documentation/diff-options.adoc > @@ -859,12 +859,18 @@ endif::git-format-patch[] > Do not show any source or destination prefix. > > `--default-prefix`:: > +ifdef::git-format-patch[] > Use the default source and destination prefixes ("a/" and "b/"). > - This overrides configuration variables such as > -ifndef::git-format-patch[`diff.noprefix`,] > -ifdef::git-format-patch[`format.noprefix`,] > + This overrides configuration variables such as `format.noprefix`, > `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` > (see linkgit:git-config[1]). > +endif::git-format-patch[] > +ifndef::git-format-patch[] > + Use the default source and destination prefixes ("a/" and "b/"). > + This overrides configuration variables such as `diff.noprefix`, > + `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` > + (see linkgit:git-config[1]). > +endif::git-format-patch[] > > `--line-prefix=<prefix>`:: > Prepend an additional _<prefix>_ to every line of output. > > Interdiff against v1: > diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc > index e4d02cc93a9..fcfcdf0286e 100644 > --- a/Documentation/diff-options.adoc > +++ b/Documentation/diff-options.adoc > @@ -859,7 +859,6 @@ endif::git-format-patch[] > Do not show any source or destination prefix. > > `--default-prefix`:: > -// TRANSLATORS: format.noprefix / diff.noprefix > ifdef::git-format-patch[] > Use the default source and destination prefixes ("a/" and "b/"). > This overrides configuration variables such as `format.noprefix`, > @@ -871,7 +870,7 @@ ifndef::git-format-patch[] > This overrides configuration variables such as `diff.noprefix`, > `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` > (see linkgit:git-config[1]). > -ifndef::git-format-patch[] > +endif::git-format-patch[] > > `--line-prefix=<prefix>`:: > Prepend an additional _<prefix>_ to every line of output. > > Range-diff against v1: > 1: 55e56c90959 ! 1: 07acc52c3bc doc: diff-options.adoc: make *.noprefix split translatable > @@ Commit message > Instead write the two paragraphs with the only variations being this > configuration variable. > > - It’s not easy to spot the difference here. So let’s leave a comment > - for translators. > - > Reported-by: Jean-Noël Avila <jn.avila@free.fr> > Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> > > + > + ## Notes (series) ## > + Notes to the maintainer: based on topic kh/format-patch-noprefix-is-boolean > + to fix the issue reported in <ff86f877-4b75-403d-a5a4-10ab528a9691@free.fr> > + > + v2: > + • fix `endif` > + • Don’t use `TRANSLATORS` callout > + > ## Documentation/diff-options.adoc ## > @@ Documentation/diff-options.adoc: endif::git-format-patch[] > Do not show any source or destination prefix. > > `--default-prefix`:: > -+// TRANSLATORS: format.noprefix / diff.noprefix > +ifdef::git-format-patch[] > Use the default source and destination prefixes ("a/" and "b/"). > - This overrides configuration variables such as > @@ Documentation/diff-options.adoc: endif::git-format-patch[] > + This overrides configuration variables such as `diff.noprefix`, > + `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix` > + (see linkgit:git-config[1]). > -+ifndef::git-format-patch[] > ++endif::git-format-patch[] > > `--line-prefix=<prefix>`:: > Prepend an additional _<prefix>_ to every line of output. > > base-commit: b9b583bd007ca814ebd362bdd6441aac02e9414b ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2026-03-02 16:53 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-02-18 20:26 [PATCH 0/2] format-patch: make boolean and mention in diff-options.adoc kristofferhaugsbakk 2026-02-18 20:26 ` [PATCH 1/2] format-patch: make format.noprefix a boolean kristofferhaugsbakk 2026-02-19 18:03 ` Junio C Hamano 2026-02-23 23:25 ` Kristoffer Haugsbakk 2026-02-20 12:28 ` Jeff King 2026-02-18 20:26 ` [PATCH 2/2] doc: diff-options.adoc: show format.noprefix for format-patch kristofferhaugsbakk 2026-02-19 18:10 ` Junio C Hamano 2026-02-23 23:30 ` [PATCH v2 0/2] format-patch: make boolean and mention in diff-options.adoc kristofferhaugsbakk 2026-02-23 23:30 ` [PATCH v2 1/2] format-patch: make format.noprefix a boolean kristofferhaugsbakk 2026-02-23 23:30 ` [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch kristofferhaugsbakk 2026-02-27 9:57 ` Jean-Noël Avila 2026-02-27 16:51 ` Junio C Hamano 2026-02-28 12:20 ` kristofferhaugsbakk 2026-02-28 14:08 ` Jean-Noël AVILA 2026-03-01 19:21 ` [PATCH v2] doc: diff-options.adoc: make *.noprefix split translatable kristofferhaugsbakk 2026-03-02 16:53 ` Junio C Hamano
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox