{"thread":{"id":"65016","subject":"[PATCH 0/2] format-patch: make boolean and mention in diff-options.adoc","startedAt":"2026-02-18T20:26:39Z","lastAt":"2026-03-02T16:53:46Z","messageCount":16,"participants":["kristofferhaugsbakk@fastmail.com","Junio C Hamano","Jeff King","Kristoffer Haugsbakk","Jean-Noël Avila","Jean-Noël AVILA"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"536330","messageId":"CV_format.noprefix_boolean.39c@msgid.xyz","threadId":"65016","inReplyTo":null,"subject":"[PATCH 0/2] format-patch: make boolean and mention in diff-options.adoc","fromName":"","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-02-18T20:26:16Z","receivedAt":"2026-02-18T20:26:39Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n\nSee: https://lore.kernel.org/git/a9602602-5fea-40c0-a505-34133ed4d58c@app.fastmail.com/\n\nTopic name: kh/format-noprefix-boolean\n\nTopic summary: The config `format.noprefix` should act like a\nboolean. But now it is active no matter what the value is. Change it to\nact like a boolean like `diff.noprefix`. Also mention it instead of\n`diff.noprefix` in git-format-patch(1) doc.\n\nThis is a breaking change. But I have opted to die if the config is not\na boolean and just hint about the change. See also Peff’s comment on\nsuch a breaking change in that link.\n\nI have also asked here about marking breaking changes:\n\nhttps://lore.kernel.org/git/3124b359-2929-4f3f-9ac6-793277fe422b@jontes.page/T/#ma8856238748d0794a0da6c64e1c0c8a4824b996f\n\nKristoffer Haugsbakk (2):\n  format-patch: make format.noprefix a boolean\n  doc: diff-options.adoc: show format.noprefix for format-patch\n\n Documentation/diff-options.adoc |  4 +++-\n builtin/log.c                   | 13 ++++++++++++-\n t/t4014-format-patch.sh         | 16 ++++++++++++++++\n 3 files changed, 31 insertions(+), 2 deletions(-)\n\n\nbase-commit: 67ad42147a7acc2af6074753ebd03d904476118f\n-- \n2.53.0.26.g2afa8602a26\n\n"},{"id":"536331","messageId":"format.noprefix_boolean.39d@msgid.xyz","threadId":"65016","inReplyTo":"CV_format.noprefix_boolean.39c@msgid.xyz","subject":"[PATCH 1/2] format-patch: make format.noprefix a boolean","fromName":"","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-02-18T20:26:17Z","receivedAt":"2026-02-18T20:26:58Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n\nThe config `format.noprefix` was added in 8d5213de (format-patch: add\nformat.noprefix option, 2023-03-09) to support no-prefix on paths.\nThat was immediately after making git-format-patch(1) not respect\n`diff.noprefix`.[1]\n\nThe intent was to mirror `diff.noprefix`. But this config was\nunintentionally[2] implemented by enabling no-prefix if any kind of\nvalue is set.\n\n† 1: c169af8f (format-patch: do not respect diff.noprefix, 2023-03-09)\n† 2: https://lore.kernel.org/all/20260211073553.GA1867915@coredump.intra.peff.net/\n\nLet’s indeed mirror `diff.noprefix` by treating it as a boolean.\n\nThis is a breaking change. And as far as breaking changes go it is\npretty benign:\n\n• The documentation claims that this config is equivalent to\n  `diff.noprefix`; this is just a bug fix if the documentation is\n  what defines the application interface\n• Only users with non-boolean values will run into problems when we\n  try to parse it as a boolean. But what would (1) make them suspect\n  they could do that in the first place, and (2) have motivated them to\n  do it?\n• Users who have set this to `false` and expect that to mean *enable\n  format.noprefix* (current behavior) will now have the opposite\n  experience. Which is not a reasonable setup.\n\nLet’s only offer a breaking change fig leaf by hinting about the\nprevious behavior before dying.\n\nSigned-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n---\n builtin/log.c           | 13 ++++++++++++-\n t/t4014-format-patch.sh | 16 ++++++++++++++++\n 2 files changed, 28 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 5c9a8ef3632..e56af7465ae 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -1096,7 +1096,18 @@ static int git_format_config(const char *var, const char *value,\n \t\treturn 0;\n \t}\n \tif (!strcmp(var, \"format.noprefix\")) {\n-\t\tformat_no_prefix = 1;\n+\t\tformat_no_prefix = git_parse_maybe_bool(value);\n+\t\tif (format_no_prefix < 0) {\n+\t\t\tint status = die_message(\n+\t\t\t\t_(\"bad boolean config value '%s' for '%s'\"),\n+\t\t\t\tvalue, var);\n+\t\t\tfprintf(stderr,\n+\t\t\t\t_(\"hint: '%s' used to accept any value but \"\n+\t\t\t\t  \"now only\\n\"\n+\t\t\t\t  \"hint: accepts boolean values, like '%s'\\n\"),\n+\t\t\t\tvar, \"diff.noprefix\");\n+\t\t\texit(status);\n+\t\t}\n \t\treturn 0;\n \t}\n \ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 21d6d0cd9ef..645ac402a19 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -2541,10 +2541,26 @@ test_expect_success 'format-patch respects format.noprefix' '\n \tgrep \"^--- blorp\" actual\n '\n \n+test_expect_success 'format.noprefix=false' '\n+\tgit -c format.noprefix=false format-patch -1 --stdout >actual &&\n+\tgrep \"^--- a/blorp\" actual\n+'\n+\n test_expect_success 'format-patch --default-prefix overrides format.noprefix' '\n \tgit -c format.noprefix \\\n \t\tformat-patch -1 --default-prefix --stdout >actual &&\n \tgrep \"^--- a/blorp\" actual\n '\n \n+test_expect_success 'errors on format.noprefix which is not boolean' '\n+\tcat >expect <<-EOF &&\n+\tfatal: bad boolean config value ${SQ}not-a-bool${SQ} for ${SQ}format.noprefix${SQ}\n+\thint: ${SQ}format.noprefix${SQ} used to accept any value but now only\n+\thint: accepts boolean values, like ${SQ}diff.noprefix${SQ}\n+\tEOF\n+\ttest_must_fail git -c format.noprefix=not-a-bool \\\n+\t\tformat-patch -1 --stdout 2>actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_done\n-- \n2.53.0.26.g2afa8602a26\n\n"},{"id":"536332","messageId":"format.noprefix_and_--default-prefix.39e@msgid.xyz","threadId":"65016","inReplyTo":"CV_format.noprefix_boolean.39c@msgid.xyz","subject":"[PATCH 2/2] doc: diff-options.adoc: show format.noprefix for format-patch","fromName":"","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-02-18T20:26:18Z","receivedAt":"2026-02-18T20:27:16Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n\ngit-format-patch(1) uses `format.noprefix` and ignores `diff.noprefix`.\n\nThe configuration variable `format.prefix` was added as an “escape\nhatch” because “it’s unlikely that anybody really wants format.\nnoprefix=true in the first place.”[1] Based on that there doesn’t\nseem to be a need to widely advertise this configuration variable.\n\nBut in any case: the documentation for this option should not claim\nthat it overrides a config that is always ignored.\n\n† 1: 8d5213de (format-patch: add format.noprefix option, 2023-03-09)\n\nSigned-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n---\n\nNotes (series):\n    `--default-prefix` does override `format.noprefix`. See test `format-patch\n    --default-prefix overrides format.noprefix`.\n\n Documentation/diff-options.adoc | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc\nindex 9cdad6f72a0..8f632d5fe1a 100644\n--- a/Documentation/diff-options.adoc\n+++ b/Documentation/diff-options.adoc\n@@ -860,7 +860,9 @@ endif::git-format-patch[]\n \n `--default-prefix`::\n \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n-\tThis overrides configuration variables such as `diff.noprefix`,\n+\tThis overrides configuration variables such as\n+ifndef::git-format-patch[`diff.noprefix`,]\n+ifdef::git-format-patch[`format.noprefix`,]\n \t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n \t(see linkgit:git-config[1]).\n \n-- \n2.53.0.26.g2afa8602a26\n\n"},{"id":"536424","messageId":"xmqqy0ko626g.fsf@gitster.g","threadId":"65016","inReplyTo":"format.noprefix_boolean.39d@msgid.xyz","subject":"Re: [PATCH 1/2] format-patch: make format.noprefix a boolean","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-19T18:03:35Z","receivedAt":"2026-02-19T18:03:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"kristofferhaugsbakk@fastmail.com writes:\n\n> From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n>\n> The config `format.noprefix` was added in 8d5213de (format-patch: add\n> format.noprefix option, 2023-03-09) to support no-prefix on paths.\n> That was immediately after making git-format-patch(1) not respect\n> `diff.noprefix`.[1]\n>\n> The intent was to mirror `diff.noprefix`. But this config was\n> unintentionally[2] implemented by enabling no-prefix if any kind of\n> value is set.\n>\n> † 1: c169af8f (format-patch: do not respect diff.noprefix, 2023-03-09)\n> † 2: https://lore.kernel.org/all/20260211073553.GA1867915@coredump.intra.peff.net/\n>\n> Let’s indeed mirror `diff.noprefix` by treating it as a boolean.\n>\n> This is a breaking change. And as far as breaking changes go it is\n> pretty benign:\n>\n> • The documentation claims that this config is equivalent to\n>   `diff.noprefix`; this is just a bug fix if the documentation is\n>   what defines the application interface\n> • Only users with non-boolean values will run into problems when we\n>   try to parse it as a boolean. But what would (1) make them suspect\n>   they could do that in the first place, and (2) have motivated them to\n>   do it?\n> • Users who have set this to `false` and expect that to mean *enable\n>   format.noprefix* (current behavior) will now have the opposite\n>   experience. Which is not a reasonable setup.\n>\n> Let’s only offer a breaking change fig leaf by hinting about the\n> previous behavior before dying.\n\nOne case that is often problematic is what happens to those who use\nthe same set of configuration variables with different versions of\nGit, before and after such behaviour change.  But I do not think\nthis is such a bad thing.  The only reason why they had this\nvariable set (to any value, or to a value-less true) with existing\nversions of Git is because they wanted to omit the prefixes, so when\na new version of Git dies with \"Heh, 'nothanks' is not a valid\nboolean value\", they can edit the configuration variable to \"1\".\n\nAnd from that point of view, I think the hint given together with\nthe \"bad boolean\" error can and should be phrased a bit more\nstrongly, i.e.,\n\n> +\t\tformat_no_prefix = git_parse_maybe_bool(value);\n> +\t\tif (format_no_prefix < 0) {\n> +\t\t\tint status = die_message(\n> +\t\t\t\t_(\"bad boolean config value '%s' for '%s'\"),\n> +\t\t\t\tvalue, var);\n> +\t\t\tfprintf(stderr,\n> +\t\t\t\t_(\"hint: '%s' used to accept any value but \"\n> +\t\t\t\t  \"now only\\n\"\n> +\t\t\t\t  \"hint: accepts boolean values, like '%s'\\n\"),\n> +\t\t\t\tvar, \"diff.noprefix\");\n\nThe target audience of this (hint) is those who have set this\nvariable to a non-boolean strring from the existing version of Git,\nand the only thing they meant to express was \"I do not want any\nprefix\", so \"we used to accept any value as true, but now accepts\nonly valid boolean values\", perhaps?  That would nudge those who\nwrote \"[format] noprefix = NoThanks\" to rewrite it correctly to\n\"true\" or \"1\", and not \"no\".\n\nThis is a related tangent, but shouldn't this use advise() without\nconfiguration?  There is no need to allocate an advice_type and use\nadvise_if_enabled(), because correcting a malformed configuration is\nan action enough to squelch the message.\n\n> +\t\t\texit(status);\n> +\t\t}\n>  \t\treturn 0;\n>  \t}\n"},{"id":"536425","messageId":"xmqqtsvc61u6.fsf@gitster.g","threadId":"65016","inReplyTo":"format.noprefix_and_--default-prefix.39e@msgid.xyz","subject":"Re: [PATCH 2/2] doc: diff-options.adoc: show format.noprefix for format-patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-19T18:10:57Z","receivedAt":"2026-02-19T18:11:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"kristofferhaugsbakk@fastmail.com writes:\n\n> From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n>\n> git-format-patch(1) uses `format.noprefix` and ignores `diff.noprefix`.\n>\n> The configuration variable `format.prefix` was added as an “escape\n> hatch” because “it’s unlikely that anybody really wants format.\n> noprefix=true in the first place.”[1] Based on that there doesn’t\n> seem to be a need to widely advertise this configuration variable.\n>\n> But in any case: the documentation for this option should not claim\n> that it overrides a config that is always ignored.\n>\n> † 1: 8d5213de (format-patch: add format.noprefix option, 2023-03-09)\n>\n> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n> ---\n>\n> Notes (series):\n>     `--default-prefix` does override `format.noprefix`. See test `format-patch\n>     --default-prefix overrides format.noprefix`.\n>\n>  Documentation/diff-options.adoc | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n>\n> diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc\n> index 9cdad6f72a0..8f632d5fe1a 100644\n> --- a/Documentation/diff-options.adoc\n> +++ b/Documentation/diff-options.adoc\n> @@ -860,7 +860,9 @@ endif::git-format-patch[]\n>  \n>  `--default-prefix`::\n>  \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n> -\tThis overrides configuration variables such as `diff.noprefix`,\n> +\tThis overrides configuration variables such as\n> +ifndef::git-format-patch[`diff.noprefix`,]\n> +ifdef::git-format-patch[`format.noprefix`,]\n>  \t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n>  \t(see linkgit:git-config[1]).\n\nThe reasoning makes sense.  The ifn?def::*[<something>] syntax is\nnew to our documentation set, but we'll see soon enough how AsciiDoc\nand Asciidoctor renders them.\n\nQueued.  Thanks.\n"},{"id":"536509","messageId":"20260220122859.GA612853@coredump.intra.peff.net","threadId":"65016","inReplyTo":"format.noprefix_boolean.39d@msgid.xyz","subject":"Re: [PATCH 1/2] format-patch: make format.noprefix a boolean","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-02-20T12:28:59Z","receivedAt":"2026-02-20T12:29:06Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Feb 18, 2026 at 09:26:17PM +0100, kristofferhaugsbakk@fastmail.com wrote:\n\n> This is a breaking change. And as far as breaking changes go it is\n> pretty benign:\n> \n> • The documentation claims that this config is equivalent to\n>   `diff.noprefix`; this is just a bug fix if the documentation is\n>   what defines the application interface\n> • Only users with non-boolean values will run into problems when we\n>   try to parse it as a boolean. But what would (1) make them suspect\n>   they could do that in the first place, and (2) have motivated them to\n>   do it?\n> • Users who have set this to `false` and expect that to mean *enable\n>   format.noprefix* (current behavior) will now have the opposite\n>   experience. Which is not a reasonable setup.\n> \n> Let’s only offer a breaking change fig leaf by hinting about the\n> previous behavior before dying.\n\nThanks for following through with this. I probably would not have\nbothered with even the fig leaf, and just considered it a bug fix. But\nsince you bothered to write it, I don't object.\n\n-Peff\n"},{"id":"536890","messageId":"ff92bec9-19b1-4107-9208-f692709ba9b4@app.fastmail.com","threadId":"65016","inReplyTo":"xmqqy0ko626g.fsf@gitster.g","subject":"Re: [PATCH 1/2] format-patch: make format.noprefix a boolean","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-02-23T23:25:22Z","receivedAt":"2026-02-23T23:25:43Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Thu, Feb 19, 2026, at 19:03, Junio C Hamano wrote:\n>>[snip]\n>> Let’s only offer a breaking change fig leaf by hinting about the\n>> previous behavior before dying.\n>\n> One case that is often problematic is what happens to those who use\n> the same set of configuration variables with different versions of\n> Git, before and after such behaviour change.  But I do not think\n> this is such a bad thing.  The only reason why they had this\n> variable set (to any value, or to a value-less true) with existing\n> versions of Git is because they wanted to omit the prefixes, so when\n> a new version of Git dies with \"Heh, 'nothanks' is not a valid\n> boolean value\", they can edit the configuration variable to \"1\".\n\nYeah.\n\nI like how this was handled for `core.commentString`: You can set both\n`core.commentChar` and the new config and still be able to run on old\nversions.\n\n> And from that point of view, I think the hint given together with\n> the \"bad boolean\" error can and should be phrased a bit more\n> strongly, i.e.,\n>\n>> +\t\tformat_no_prefix = git_parse_maybe_bool(value);\n>> +\t\tif (format_no_prefix < 0) {\n>> +\t\t\tint status = die_message(\n>> +\t\t\t\t_(\"bad boolean config value '%s' for '%s'\"),\n>> +\t\t\t\tvalue, var);\n>> +\t\t\tfprintf(stderr,\n>> +\t\t\t\t_(\"hint: '%s' used to accept any value but \"\n>> +\t\t\t\t  \"now only\\n\"\n>> +\t\t\t\t  \"hint: accepts boolean values, like '%s'\\n\"),\n>> +\t\t\t\tvar, \"diff.noprefix\");\n>\n> The target audience of this (hint) is those who have set this\n> variable to a non-boolean strring from the existing version of Git,\n> and the only thing they meant to express was \"I do not want any\n> prefix\", so \"we used to accept any value as true, but now accepts\n> only valid boolean values\", perhaps?  That would nudge those who\n> wrote \"[format] noprefix = NoThanks\" to rewrite it correctly to\n> \"true\" or \"1\", and not \"no\".\n\nVery true. I’ll change to spell out that any value used to be\ntreated as `true`.\n\nRight now it just says “used to accept any value”. But not what it means\nto accept any value...\n\n> This is a related tangent, but shouldn't this use advise() without\n> configuration?  There is no need to allocate an advice_type and use\n> advise_if_enabled(), because correcting a malformed configuration is\n> an action enough to squelch the message.\n\nOh, right. That fits well here.\n\nIn hindsight I think I should have used that in 5a312527 (whatchanged:\nhint about git-log(1) and aliasing, 2025-09-17).\n"},{"id":"536891","messageId":"V2_CV_format.noprefix_boolean.421@msgid.xyz","threadId":"65016","inReplyTo":"CV_format.noprefix_boolean.39c@msgid.xyz","subject":"[PATCH v2 0/2] format-patch: make boolean and mention in diff-options.adoc","fromName":"","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-02-23T23:30:49Z","receivedAt":"2026-02-23T23:31:02Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n\nSee: https://lore.kernel.org/git/a9602602-5fea-40c0-a505-34133ed4d58c@app.fastmail.com/\n\nTopic name (applied): kh/format-patch-noprefix-is-boolean\n\nTopic summary: The config `format.noprefix` should act like a\nboolean. But now it is active no matter what the value is. Change it to\nact like a boolean like `diff.noprefix`. Also mention it instead of\n`diff.noprefix` in git-format-patch(1) doc.\n\n§ Changes in v2\n\nGot feedback from Junio.\n\nCopied from note on Patch 1/2:\n\n• Use `advise()` for the hint; you get the `hint:` prefix and color\n• Rework the hint, or the advise, to say that any value *used to be*\n  treated as `true`. That better helps people who maybe set `nope` when\n  they meant, “no, I don’t want any prefix” (for example)\n\nAlso a commit message tweak on Patch 2/2.\n\n§ Link to v1\n\nhttps://lore.kernel.org/git/CV_format.noprefix_boolean.39c@msgid.xyz/\n\n§ Breaking change (unchanged since v1)\n\nThis is a breaking change. But I have opted to die if the config is not\na boolean and just hint about the change. See also Peff’s comment on\nsuch a breaking change in that link.\n\nI have also asked here about marking breaking changes:\n\nhttps://lore.kernel.org/git/3124b359-2929-4f3f-9ac6-793277fe422b@jontes.page/T/#ma8856238748d0794a0da6c64e1c0c8a4824b996f\n\nKristoffer Haugsbakk (2):\n  format-patch: make format.noprefix a boolean\n  doc: diff-options.adoc: show format.noprefix for format-patch\n\n Documentation/diff-options.adoc |  4 +++-\n builtin/log.c                   | 14 +++++++++++++-\n t/t4014-format-patch.sh         | 16 ++++++++++++++++\n 3 files changed, 32 insertions(+), 2 deletions(-)\n\nInterdiff against v1:\ndiff --git a/builtin/log.c b/builtin/log.c\nindex e56af7465ae..275122b807e 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -40,6 +40,7 @@\n #include \"mailmap.h\"\n #include \"progress.h\"\n #include \"commit-slab.h\"\n+#include \"advice.h\"\n \n #include \"commit-reach.h\"\n #include \"range-diff.h\"\n@@ -1101,11 +1102,11 @@ static int git_format_config(const char *var, const char *value,\n \t\t\tint status = die_message(\n \t\t\t\t_(\"bad boolean config value '%s' for '%s'\"),\n \t\t\t\tvalue, var);\n-\t\t\tfprintf(stderr,\n-\t\t\t\t_(\"hint: '%s' used to accept any value but \"\n-\t\t\t\t  \"now only\\n\"\n-\t\t\t\t  \"hint: accepts boolean values, like '%s'\\n\"),\n-\t\t\t\tvar, \"diff.noprefix\");\n+\t\t\tadvise(_(\"'%s' used to accept any value and \"\n+\t\t\t\t \"treat that as 'true'.\\n\"\n+\t\t\t\t \"Now it only accepts boolean values, \"\n+\t\t\t\t \"like what '%s' does.\\n\"),\n+\t\t\t       var, \"diff.noprefix\");\n \t\t\texit(status);\n \t\t}\n \t\treturn 0;\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 645ac402a19..c20091e36fe 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -2555,8 +2555,8 @@ test_expect_success 'format-patch --default-prefix overrides format.noprefix' '\n test_expect_success 'errors on format.noprefix which is not boolean' '\n \tcat >expect <<-EOF &&\n \tfatal: bad boolean config value ${SQ}not-a-bool${SQ} for ${SQ}format.noprefix${SQ}\n-\thint: ${SQ}format.noprefix${SQ} used to accept any value but now only\n-\thint: accepts boolean values, like ${SQ}diff.noprefix${SQ}\n+\thint: ${SQ}format.noprefix${SQ} used to accept any value and treat that as ${SQ}true${SQ}.\n+\thint: Now it only accepts boolean values, like what ${SQ}diff.noprefix${SQ} does.\n \tEOF\n \ttest_must_fail git -c format.noprefix=not-a-bool \\\n \t\tformat-patch -1 --stdout 2>actual &&\nRange-diff against v1:\n1:  49fa161a392 ! 1:  eee61561eb3 format-patch: make format.noprefix a boolean\n    @@ Commit message\n           format.noprefix* (current behavior) will now have the opposite\n           experience. Which is not a reasonable setup.\n     \n    -    Let’s only offer a breaking change fig leaf by hinting about the\n    +    Let’s only offer a breaking change fig leaf by advising about the\n         previous behavior before dying.\n     \n         Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n     \n      ## builtin/log.c ##\n    +@@\n    + #include \"mailmap.h\"\n    + #include \"progress.h\"\n    + #include \"commit-slab.h\"\n    ++#include \"advice.h\"\n    + \n    + #include \"commit-reach.h\"\n    + #include \"range-diff.h\"\n     @@ builtin/log.c: static int git_format_config(const char *var, const char *value,\n      \t\treturn 0;\n      \t}\n    @@ builtin/log.c: static int git_format_config(const char *var, const char *value,\n     +\t\t\tint status = die_message(\n     +\t\t\t\t_(\"bad boolean config value '%s' for '%s'\"),\n     +\t\t\t\tvalue, var);\n    -+\t\t\tfprintf(stderr,\n    -+\t\t\t\t_(\"hint: '%s' used to accept any value but \"\n    -+\t\t\t\t  \"now only\\n\"\n    -+\t\t\t\t  \"hint: accepts boolean values, like '%s'\\n\"),\n    -+\t\t\t\tvar, \"diff.noprefix\");\n    ++\t\t\tadvise(_(\"'%s' used to accept any value and \"\n    ++\t\t\t\t \"treat that as 'true'.\\n\"\n    ++\t\t\t\t \"Now it only accepts boolean values, \"\n    ++\t\t\t\t \"like what '%s' does.\\n\"),\n    ++\t\t\t       var, \"diff.noprefix\");\n     +\t\t\texit(status);\n     +\t\t}\n      \t\treturn 0;\n    @@ t/t4014-format-patch.sh: test_expect_success 'format-patch respects format.nopre\n     +test_expect_success 'errors on format.noprefix which is not boolean' '\n     +\tcat >expect <<-EOF &&\n     +\tfatal: bad boolean config value ${SQ}not-a-bool${SQ} for ${SQ}format.noprefix${SQ}\n    -+\thint: ${SQ}format.noprefix${SQ} used to accept any value but now only\n    -+\thint: accepts boolean values, like ${SQ}diff.noprefix${SQ}\n    ++\thint: ${SQ}format.noprefix${SQ} used to accept any value and treat that as ${SQ}true${SQ}.\n    ++\thint: Now it only accepts boolean values, like what ${SQ}diff.noprefix${SQ} does.\n     +\tEOF\n     +\ttest_must_fail git -c format.noprefix=not-a-bool \\\n     +\t\tformat-patch -1 --stdout 2>actual &&\n2:  0cef1915a9c ! 2:  b9b583bd007 doc: diff-options.adoc: show format.noprefix for format-patch\n    @@ Commit message\n         git-format-patch(1) uses `format.noprefix` and ignores `diff.noprefix`.\n     \n         The configuration variable `format.prefix` was added as an “escape\n    -    hatch” because “it’s unlikely that anybody really wants format.\n    +    hatch”, and “it’s unlikely that anybody really wants format.\n         noprefix=true in the first place.”[1] Based on that there doesn’t\n         seem to be a need to widely advertise this configuration variable.\n     \n\nbase-commit: 67ad42147a7acc2af6074753ebd03d904476118f\n-- \n2.53.0.26.g2afa8602a26\n\n"},{"id":"536892","messageId":"V2_format.noprefix_boolean.422@msgid.xyz","threadId":"65016","inReplyTo":"V2_CV_format.noprefix_boolean.421@msgid.xyz","subject":"[PATCH v2 1/2] format-patch: make format.noprefix a boolean","fromName":"","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-02-23T23:30:50Z","receivedAt":"2026-02-23T23:31:20Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n\nThe config `format.noprefix` was added in 8d5213de (format-patch: add\nformat.noprefix option, 2023-03-09) to support no-prefix on paths.\nThat was immediately after making git-format-patch(1) not respect\n`diff.noprefix`.[1]\n\nThe intent was to mirror `diff.noprefix`. But this config was\nunintentionally[2] implemented by enabling no-prefix if any kind of\nvalue is set.\n\n† 1: c169af8f (format-patch: do not respect diff.noprefix, 2023-03-09)\n† 2: https://lore.kernel.org/all/20260211073553.GA1867915@coredump.intra.peff.net/\n\nLet’s indeed mirror `diff.noprefix` by treating it as a boolean.\n\nThis is a breaking change. And as far as breaking changes go it is\npretty benign:\n\n• The documentation claims that this config is equivalent to\n  `diff.noprefix`; this is just a bug fix if the documentation is\n  what defines the application interface\n• Only users with non-boolean values will run into problems when we\n  try to parse it as a boolean. But what would (1) make them suspect\n  they could do that in the first place, and (2) have motivated them to\n  do it?\n• Users who have set this to `false` and expect that to mean *enable\n  format.noprefix* (current behavior) will now have the opposite\n  experience. Which is not a reasonable setup.\n\nLet’s only offer a breaking change fig leaf by advising about the\nprevious behavior before dying.\n\nSigned-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n---\n\nNotes (series):\n    v2:\n    • Use `advise()` for the hint; you get the `hint:` prefix and color\n    • Rework the hint, or the advise, to say that any value *used to be*\n      treated as `true`. That better helps people who maybe set `nope` when\n      they meant, “no, I don’t want any prefix” (for example)\n\n builtin/log.c           | 14 +++++++++++++-\n t/t4014-format-patch.sh | 16 ++++++++++++++++\n 2 files changed, 29 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 5c9a8ef3632..275122b807e 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -40,6 +40,7 @@\n #include \"mailmap.h\"\n #include \"progress.h\"\n #include \"commit-slab.h\"\n+#include \"advice.h\"\n \n #include \"commit-reach.h\"\n #include \"range-diff.h\"\n@@ -1096,7 +1097,18 @@ static int git_format_config(const char *var, const char *value,\n \t\treturn 0;\n \t}\n \tif (!strcmp(var, \"format.noprefix\")) {\n-\t\tformat_no_prefix = 1;\n+\t\tformat_no_prefix = git_parse_maybe_bool(value);\n+\t\tif (format_no_prefix < 0) {\n+\t\t\tint status = die_message(\n+\t\t\t\t_(\"bad boolean config value '%s' for '%s'\"),\n+\t\t\t\tvalue, var);\n+\t\t\tadvise(_(\"'%s' used to accept any value and \"\n+\t\t\t\t \"treat that as 'true'.\\n\"\n+\t\t\t\t \"Now it only accepts boolean values, \"\n+\t\t\t\t \"like what '%s' does.\\n\"),\n+\t\t\t       var, \"diff.noprefix\");\n+\t\t\texit(status);\n+\t\t}\n \t\treturn 0;\n \t}\n \ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 21d6d0cd9ef..c20091e36fe 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -2541,10 +2541,26 @@ test_expect_success 'format-patch respects format.noprefix' '\n \tgrep \"^--- blorp\" actual\n '\n \n+test_expect_success 'format.noprefix=false' '\n+\tgit -c format.noprefix=false format-patch -1 --stdout >actual &&\n+\tgrep \"^--- a/blorp\" actual\n+'\n+\n test_expect_success 'format-patch --default-prefix overrides format.noprefix' '\n \tgit -c format.noprefix \\\n \t\tformat-patch -1 --default-prefix --stdout >actual &&\n \tgrep \"^--- a/blorp\" actual\n '\n \n+test_expect_success 'errors on format.noprefix which is not boolean' '\n+\tcat >expect <<-EOF &&\n+\tfatal: bad boolean config value ${SQ}not-a-bool${SQ} for ${SQ}format.noprefix${SQ}\n+\thint: ${SQ}format.noprefix${SQ} used to accept any value and treat that as ${SQ}true${SQ}.\n+\thint: Now it only accepts boolean values, like what ${SQ}diff.noprefix${SQ} does.\n+\tEOF\n+\ttest_must_fail git -c format.noprefix=not-a-bool \\\n+\t\tformat-patch -1 --stdout 2>actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_done\n-- \n2.53.0.26.g2afa8602a26\n\n"},{"id":"536893","messageId":"V2_format.noprefix_and_--default-prefix.423@msgid.xyz","threadId":"65016","inReplyTo":"V2_CV_format.noprefix_boolean.421@msgid.xyz","subject":"[PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch","fromName":"","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-02-23T23:30:51Z","receivedAt":"2026-02-23T23:31:38Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n\ngit-format-patch(1) uses `format.noprefix` and ignores `diff.noprefix`.\n\nThe configuration variable `format.prefix` was added as an “escape\nhatch”, and “it’s unlikely that anybody really wants format.\nnoprefix=true in the first place.”[1] Based on that there doesn’t\nseem to be a need to widely advertise this configuration variable.\n\nBut in any case: the documentation for this option should not claim\nthat it overrides a config that is always ignored.\n\n† 1: 8d5213de (format-patch: add format.noprefix option, 2023-03-09)\n\nSigned-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n---\n\nNotes (series):\n    v2:\n    Change commit message. Don’t use “because”: the two quotes are not causally\n    linked like that.\n    \n    v1:\n    `--default-prefix` does override `format.noprefix`. See test `format-patch\n    --default-prefix overrides format.noprefix`.\n\n Documentation/diff-options.adoc | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc\nindex 9cdad6f72a0..8f632d5fe1a 100644\n--- a/Documentation/diff-options.adoc\n+++ b/Documentation/diff-options.adoc\n@@ -860,7 +860,9 @@ endif::git-format-patch[]\n \n `--default-prefix`::\n \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n-\tThis overrides configuration variables such as `diff.noprefix`,\n+\tThis overrides configuration variables such as\n+ifndef::git-format-patch[`diff.noprefix`,]\n+ifdef::git-format-patch[`format.noprefix`,]\n \t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n \t(see linkgit:git-config[1]).\n \n-- \n2.53.0.26.g2afa8602a26\n\n"},{"id":"537280","messageId":"ff86f877-4b75-403d-a5a4-10ab528a9691@free.fr","threadId":"65016","inReplyTo":"V2_format.noprefix_and_--default-prefix.423@msgid.xyz","subject":"Re: [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch","fromName":"Jean-Noël Avila","fromEmail":"jn.avila@free.fr","sentAt":"2026-02-27T09:57:58Z","receivedAt":"2026-02-27T09:58:18Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Le 24/02/2026 à 00:30, kristofferhaugsbakk@fastmail.com a écrit :\n> From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n> \n> git-format-patch(1) uses `format.noprefix` and ignores `diff.noprefix`.\n> \n> The configuration variable `format.prefix` was added as an “escape\n> hatch”, and “it’s unlikely that anybody really wants format.\n> noprefix=true in the first place.”[1] Based on that there doesn’t\n> seem to be a need to widely advertise this configuration variable.\n> \n> But in any case: the documentation for this option should not claim\n> that it overrides a config that is always ignored.\n> \n> † 1: 8d5213de (format-patch: add format.noprefix option, 2023-03-09)\n> \n> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n> ---\n> \n> Notes (series):\n>     v2:\n>     Change commit message. Don’t use “because”: the two quotes are not causally\n>     linked like that.\n>     \n>     v1:\n>     `--default-prefix` does override `format.noprefix`. See test `format-patch\n>     --default-prefix overrides format.noprefix`.\n> \n>  Documentation/diff-options.adoc | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n> \n> diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc\n> index 9cdad6f72a0..8f632d5fe1a 100644\n> --- a/Documentation/diff-options.adoc\n> +++ b/Documentation/diff-options.adoc\n> @@ -860,7 +860,9 @@ endif::git-format-patch[]\n>  \n>  `--default-prefix`::\n>  \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n> -\tThis overrides configuration variables such as `diff.noprefix`,\n> +\tThis overrides configuration variables such as\n> +ifndef::git-format-patch[`diff.noprefix`,]\n> +ifdef::git-format-patch[`format.noprefix`,]\n>  \t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n>  \t(see linkgit:git-config[1]).\n>  \n\nHello,\n\nThis kind of sentence assembly does not fit well with translations. Each\nhunk of the sentence is processed separately and it is a difficulty for\ntranslators as they need to understand the surrounding context of a\nsegment when translating it.\n\nIt is safer to just write the whole paragraph, or at least a sentence in\nthe ifdef/ifndef sections.\n\nThanks\n\n\n"},{"id":"537303","messageId":"xmqq4in2t9j8.fsf@gitster.g","threadId":"65016","inReplyTo":"ff86f877-4b75-403d-a5a4-10ab528a9691@free.fr","subject":"Re: [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-27T16:51:07Z","receivedAt":"2026-02-27T16:51:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Noël Avila <jn.avila@free.fr> writes:\n\n>>  `--default-prefix`::\n>>  \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n>> -\tThis overrides configuration variables such as `diff.noprefix`,\n>> +\tThis overrides configuration variables such as\n>> +ifndef::git-format-patch[`diff.noprefix`,]\n>> +ifdef::git-format-patch[`format.noprefix`,]\n>>  \t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n>>  \t(see linkgit:git-config[1]).\n>>  \n>\n> Hello,\n>\n> This kind of sentence assembly does not fit well with translations. Each\n> hunk of the sentence is processed separately and it is a difficulty for\n> translators as they need to understand the surrounding context of a\n> segment when translating it.\n>\n> It is safer to just write the whole paragraph, or at least a sentence in\n> the ifdef/ifndef sections.\n\nThanks, this particular patch in question is already in 'next',\nthough.\n"},{"id":"537392","messageId":"better_for_translators.424@msgid.xyz","threadId":"65016","inReplyTo":"ff86f877-4b75-403d-a5a4-10ab528a9691@free.fr","subject":"Re: [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch","fromName":"","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-02-28T12:20:33Z","receivedAt":"2026-02-28T12:21:22Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n\nOn Fri, Feb 27, 2026, at 10:57, Jean-Noël Avila wrote:\n> Le 24/02/2026 à 00:30, kristofferhaugsbakk@fastmail.com a écrit :\n>> From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n>>[snip]\n>>  `--default-prefix`::\n>>  \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n>> -\tThis overrides configuration variables such as `diff.noprefix`,\n>> +\tThis overrides configuration variables such as\n>> +ifndef::git-format-patch[`diff.noprefix`,]\n>> +ifdef::git-format-patch[`format.noprefix`,]\n>>  \t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n>>  \t(see linkgit:git-config[1]).\n>>\n>\n> Hello,\n>\n> This kind of sentence assembly does not fit well with translations. Each\n> hunk of the sentence is processed separately and it is a difficulty for\n> translators as they need to understand the surrounding context of a\n> segment when translating it.\n>\n> It is safer to just write the whole paragraph, or at least a sentence in\n> the ifdef/ifndef sections.\n\nThanks for bringing this up. I have never taken doc translations into\nconsideration.\n\nWould the following be the correct approach?\n\n-- 8< --\nFrom: Kristoffer Haugsbakk <code@khaugsbakk.name>\nSubject: [PATCH] doc: diff-options.adoc: make *.noprefix split translatable\n\nWe cannot split single words like what we did in the previous\ncommit. That is because the doc translations are processed in\nbigger chunks.\n\nInstead write the two paragraphs with the only variations being this\nconfiguration variable.\n\nIt’s not easy to spot the difference here. So let’s leave a comment\nfor translators.\n\nReported-by: Jean-Noël Avila <jn.avila@free.fr>\nSigned-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n---\n Documentation/diff-options.adoc | 13 ++++++++++---\n 1 file changed, 10 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc\nindex 8f632d5fe1a..e4d02cc93a9 100644\n--- a/Documentation/diff-options.adoc\n+++ b/Documentation/diff-options.adoc\n@@ -859,12 +859,19 @@ endif::git-format-patch[]\n \tDo not show any source or destination prefix.\n \n `--default-prefix`::\n+// TRANSLATORS: format.noprefix / diff.noprefix\n+ifdef::git-format-patch[]\n \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n-\tThis overrides configuration variables such as\n-ifndef::git-format-patch[`diff.noprefix`,]\n-ifdef::git-format-patch[`format.noprefix`,]\n+\tThis overrides configuration variables such as `format.noprefix`,\n \t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n \t(see linkgit:git-config[1]).\n+endif::git-format-patch[]\n+ifndef::git-format-patch[]\n+\tUse the default source and destination prefixes (\"a/\" and \"b/\").\n+\tThis overrides configuration variables such as `diff.noprefix`,\n+\t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n+\t(see linkgit:git-config[1]).\n+ifndef::git-format-patch[]\n \n `--line-prefix=<prefix>`::\n \tPrepend an additional _<prefix>_ to every line of output.\n\nbase-commit: b9b583bd007ca814ebd362bdd6441aac02e9414b\n-- \n2.53.0.26.g2afa8602a26\n\n"},{"id":"537395","messageId":"5970320.DvuYhMxLoT@piment-oiseau","threadId":"65016","inReplyTo":"better_for_translators.424@msgid.xyz","subject":"Re: [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch","fromName":"Jean-Noël AVILA","fromEmail":"jn.avila@free.fr","sentAt":"2026-02-28T14:08:41Z","receivedAt":"2026-02-28T14:09:02Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"On Saturday, 28 February 2026 13:20:33 CET kristofferhaugsbakk@fastmail.com \nwrote:\n> From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n> \n> On Fri, Feb 27, 2026, at 10:57, Jean-Noël Avila wrote:\n> > Le 24/02/2026 à 00:30, kristofferhaugsbakk@fastmail.com a écrit :\n> >> From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n> >>\n> >>[snip]\n> >>\n> >>  `--default-prefix`::\n> >>  \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n> >> \n> >> -\tThis overrides configuration variables such as `diff.noprefix`,\n> >> +\tThis overrides configuration variables such as\n> >> +ifndef::git-format-patch[`diff.noprefix`,]\n> >> +ifdef::git-format-patch[`format.noprefix`,]\n> >> \n> >>  \t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n> >>  \t(see linkgit:git-config[1]).\n> > \n> > Hello,\n> > \n> > This kind of sentence assembly does not fit well with translations. Each\n> > hunk of the sentence is processed separately and it is a difficulty for\n> > translators as they need to understand the surrounding context of a\n> > segment when translating it.\n> > \n> > It is safer to just write the whole paragraph, or at least a sentence in\n> > the ifdef/ifndef sections.\n> \n> Thanks for bringing this up. I have never taken doc translations into\n> consideration.\n> \n> Would the following be the correct approach?\n> \n> -- 8< --\n> From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n> Subject: [PATCH] doc: diff-options.adoc: make *.noprefix split translatable\n> \n> We cannot split single words like what we did in the previous\n> commit. That is because the doc translations are processed in\n> bigger chunks.\n> \n> Instead write the two paragraphs with the only variations being this\n> configuration variable.\n> \n> It’s not easy to spot the difference here. So let’s leave a comment\n> for translators.\n> \n> Reported-by: Jean-Noël Avila <jn.avila@free.fr>\n> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n> ---\n>  Documentation/diff-options.adoc | 13 ++++++++++---\n>  1 file changed, 10 insertions(+), 3 deletions(-)\n> \n> diff --git a/Documentation/diff-options.adoc b/Documentation/diff-\noptions.adoc\n> index 8f632d5fe1a..e4d02cc93a9 100644\n> --- a/Documentation/diff-options.adoc\n> +++ b/Documentation/diff-options.adoc\n> @@ -859,12 +859,19 @@ endif::git-format-patch[]\n>  \tDo not show any source or destination prefix.\n> \n>  `--default-prefix`::\n> +// TRANSLATORS: format.noprefix / diff.noprefix\n> +ifdef::git-format-patch[]\n>  \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n> -\tThis overrides configuration variables such as\n> -ifndef::git-format-patch[`diff.noprefix`,]\n> -ifdef::git-format-patch[`format.noprefix`,]\n> +\tThis overrides configuration variables such as `format.noprefix`,\n>  \t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n>  \t(see linkgit:git-config[1]).\n> +endif::git-format-patch[]\n> +ifndef::git-format-patch[]\n> +\tUse the default source and destination prefixes (\"a/\" and \"b/\").\n> +\tThis overrides configuration variables such as `diff.noprefix`,\n> +\t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n> +\t(see linkgit:git-config[1]).\n> +ifndef::git-format-patch[]\n\nI think this line should read : endif::git-format-patch[]\nI also don't quite understand the addition of the // TRANSLATORS: part. This \nis not needed as each paragraph will be translated as a standalone segment.\n\nOtherwise, this format of conditional text is fit for translation.\n\nThanks\n\n\n\n\n\n"},{"id":"537470","messageId":"V2_better_for_translators.43b@msgid.xyz","threadId":"65016","inReplyTo":"better_for_translators.424@msgid.xyz","subject":"[PATCH v2] doc: diff-options.adoc: make *.noprefix split translatable","fromName":"","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-03-01T19:21:14Z","receivedAt":"2026-03-01T19:22:28Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n\nWe cannot split single words like what we did in the previous\ncommit. That is because the doc translations are processed in\nbigger chunks.\n\nInstead write the two paragraphs with the only variations being this\nconfiguration variable.\n\nReported-by: Jean-Noël Avila <jn.avila@free.fr>\nSigned-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n---\n\nNotes (series):\n    Notes to the maintainer: based on topic kh/format-patch-noprefix-is-boolean\n    to fix the issue reported in <ff86f877-4b75-403d-a5a4-10ab528a9691@free.fr>\n    \n    v2:\n    • fix `endif`\n    • Don’t use `TRANSLATORS` callout\n\n Documentation/diff-options.adoc | 12 +++++++++---\n 1 file changed, 9 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc\nindex 8f632d5fe1a..fcfcdf0286e 100644\n--- a/Documentation/diff-options.adoc\n+++ b/Documentation/diff-options.adoc\n@@ -859,12 +859,18 @@ endif::git-format-patch[]\n \tDo not show any source or destination prefix.\n \n `--default-prefix`::\n+ifdef::git-format-patch[]\n \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n-\tThis overrides configuration variables such as\n-ifndef::git-format-patch[`diff.noprefix`,]\n-ifdef::git-format-patch[`format.noprefix`,]\n+\tThis overrides configuration variables such as `format.noprefix`,\n \t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n \t(see linkgit:git-config[1]).\n+endif::git-format-patch[]\n+ifndef::git-format-patch[]\n+\tUse the default source and destination prefixes (\"a/\" and \"b/\").\n+\tThis overrides configuration variables such as `diff.noprefix`,\n+\t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n+\t(see linkgit:git-config[1]).\n+endif::git-format-patch[]\n \n `--line-prefix=<prefix>`::\n \tPrepend an additional _<prefix>_ to every line of output.\n\nInterdiff against v1:\n  diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc\n  index e4d02cc93a9..fcfcdf0286e 100644\n  --- a/Documentation/diff-options.adoc\n  +++ b/Documentation/diff-options.adoc\n  @@ -859,7 +859,6 @@ endif::git-format-patch[]\n   \tDo not show any source or destination prefix.\n   \n   `--default-prefix`::\n  -// TRANSLATORS: format.noprefix / diff.noprefix\n   ifdef::git-format-patch[]\n   \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n   \tThis overrides configuration variables such as `format.noprefix`,\n  @@ -871,7 +870,7 @@ ifndef::git-format-patch[]\n   \tThis overrides configuration variables such as `diff.noprefix`,\n   \t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n   \t(see linkgit:git-config[1]).\n  -ifndef::git-format-patch[]\n  +endif::git-format-patch[]\n   \n   `--line-prefix=<prefix>`::\n   \tPrepend an additional _<prefix>_ to every line of output.\n\nRange-diff against v1:\n1:  55e56c90959 ! 1:  07acc52c3bc doc: diff-options.adoc: make *.noprefix split translatable\n    @@ Commit message\n         Instead write the two paragraphs with the only variations being this\n         configuration variable.\n     \n    -    It’s not easy to spot the difference here. So let’s leave a comment\n    -    for translators.\n    -\n         Reported-by: Jean-Noël Avila <jn.avila@free.fr>\n         Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n     \n    +\n    + ## Notes (series) ##\n    +    Notes to the maintainer: based on topic kh/format-patch-noprefix-is-boolean\n    +    to fix the issue reported in <ff86f877-4b75-403d-a5a4-10ab528a9691@free.fr>\n    +\n    +    v2:\n    +    • fix `endif`\n    +    • Don’t use `TRANSLATORS` callout\n    +\n      ## Documentation/diff-options.adoc ##\n     @@ Documentation/diff-options.adoc: endif::git-format-patch[]\n      \tDo not show any source or destination prefix.\n      \n      `--default-prefix`::\n    -+// TRANSLATORS: format.noprefix / diff.noprefix\n     +ifdef::git-format-patch[]\n      \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n     -\tThis overrides configuration variables such as\n    @@ Documentation/diff-options.adoc: endif::git-format-patch[]\n     +\tThis overrides configuration variables such as `diff.noprefix`,\n     +\t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n     +\t(see linkgit:git-config[1]).\n    -+ifndef::git-format-patch[]\n    ++endif::git-format-patch[]\n      \n      `--line-prefix=<prefix>`::\n      \tPrepend an additional _<prefix>_ to every line of output.\n\nbase-commit: b9b583bd007ca814ebd362bdd6441aac02e9414b\n-- \n2.53.0.26.g2afa8602a26\n\n"},{"id":"537554","messageId":"xmqqldga2mw7.fsf@gitster.g","threadId":"65016","inReplyTo":"V2_better_for_translators.43b@msgid.xyz","subject":"Re: [PATCH v2] doc: diff-options.adoc: make *.noprefix split translatable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-03-02T16:53:44Z","receivedAt":"2026-03-02T16:53:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"kristofferhaugsbakk@fastmail.com writes:\n\n> From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n>\n> We cannot split single words like what we did in the previous\n> commit. That is because the doc translations are processed in\n> bigger chunks.\n>\n> Instead write the two paragraphs with the only variations being this\n> configuration variable.\n>\n> Reported-by: Jean-Noël Avila <jn.avila@free.fr>\n> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n> ---\n>\n> Notes (series):\n>     Notes to the maintainer: based on topic kh/format-patch-noprefix-is-boolean\n>     to fix the issue reported in <ff86f877-4b75-403d-a5a4-10ab528a9691@free.fr>\n>     \n>     v2:\n>     • fix `endif`\n>     • Don’t use `TRANSLATORS` callout\n\nThanks.  Looking good.  Will queue on top.\n\n\n\n>  Documentation/diff-options.adoc | 12 +++++++++---\n>  1 file changed, 9 insertions(+), 3 deletions(-)\n>\n> diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc\n> index 8f632d5fe1a..fcfcdf0286e 100644\n> --- a/Documentation/diff-options.adoc\n> +++ b/Documentation/diff-options.adoc\n> @@ -859,12 +859,18 @@ endif::git-format-patch[]\n>  \tDo not show any source or destination prefix.\n>  \n>  `--default-prefix`::\n> +ifdef::git-format-patch[]\n>  \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n> -\tThis overrides configuration variables such as\n> -ifndef::git-format-patch[`diff.noprefix`,]\n> -ifdef::git-format-patch[`format.noprefix`,]\n> +\tThis overrides configuration variables such as `format.noprefix`,\n>  \t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n>  \t(see linkgit:git-config[1]).\n> +endif::git-format-patch[]\n> +ifndef::git-format-patch[]\n> +\tUse the default source and destination prefixes (\"a/\" and \"b/\").\n> +\tThis overrides configuration variables such as `diff.noprefix`,\n> +\t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n> +\t(see linkgit:git-config[1]).\n> +endif::git-format-patch[]\n>  \n>  `--line-prefix=<prefix>`::\n>  \tPrepend an additional _<prefix>_ to every line of output.\n>\n> Interdiff against v1:\n>   diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc\n>   index e4d02cc93a9..fcfcdf0286e 100644\n>   --- a/Documentation/diff-options.adoc\n>   +++ b/Documentation/diff-options.adoc\n>   @@ -859,7 +859,6 @@ endif::git-format-patch[]\n>    \tDo not show any source or destination prefix.\n>    \n>    `--default-prefix`::\n>   -// TRANSLATORS: format.noprefix / diff.noprefix\n>    ifdef::git-format-patch[]\n>    \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n>    \tThis overrides configuration variables such as `format.noprefix`,\n>   @@ -871,7 +870,7 @@ ifndef::git-format-patch[]\n>    \tThis overrides configuration variables such as `diff.noprefix`,\n>    \t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n>    \t(see linkgit:git-config[1]).\n>   -ifndef::git-format-patch[]\n>   +endif::git-format-patch[]\n>    \n>    `--line-prefix=<prefix>`::\n>    \tPrepend an additional _<prefix>_ to every line of output.\n>\n> Range-diff against v1:\n> 1:  55e56c90959 ! 1:  07acc52c3bc doc: diff-options.adoc: make *.noprefix split translatable\n>     @@ Commit message\n>          Instead write the two paragraphs with the only variations being this\n>          configuration variable.\n>      \n>     -    It’s not easy to spot the difference here. So let’s leave a comment\n>     -    for translators.\n>     -\n>          Reported-by: Jean-Noël Avila <jn.avila@free.fr>\n>          Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n>      \n>     +\n>     + ## Notes (series) ##\n>     +    Notes to the maintainer: based on topic kh/format-patch-noprefix-is-boolean\n>     +    to fix the issue reported in <ff86f877-4b75-403d-a5a4-10ab528a9691@free.fr>\n>     +\n>     +    v2:\n>     +    • fix `endif`\n>     +    • Don’t use `TRANSLATORS` callout\n>     +\n>       ## Documentation/diff-options.adoc ##\n>      @@ Documentation/diff-options.adoc: endif::git-format-patch[]\n>       \tDo not show any source or destination prefix.\n>       \n>       `--default-prefix`::\n>     -+// TRANSLATORS: format.noprefix / diff.noprefix\n>      +ifdef::git-format-patch[]\n>       \tUse the default source and destination prefixes (\"a/\" and \"b/\").\n>      -\tThis overrides configuration variables such as\n>     @@ Documentation/diff-options.adoc: endif::git-format-patch[]\n>      +\tThis overrides configuration variables such as `diff.noprefix`,\n>      +\t`diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`\n>      +\t(see linkgit:git-config[1]).\n>     -+ifndef::git-format-patch[]\n>     ++endif::git-format-patch[]\n>       \n>       `--line-prefix=<prefix>`::\n>       \tPrepend an additional _<prefix>_ to every line of output.\n>\n> base-commit: b9b583bd007ca814ebd362bdd6441aac02e9414b\n"}]}