From 3d61c1988b5d9468113dbe250e99eaabd3832090 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Thu, 8 Jan 2026 07:28:15 +0100 Subject: [PATCH 1/6] =?UTF-8?q?doc:=20patch-id:=20don=E2=80=99t=20use=20se?= =?UTF-8?q?micolon=20between=20bullet=20points?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These bullet points are full-fledged paragraphs with sentences. It’s best to restrict semicolon-termination to the case when the bullet list amounts to a list of items.[1] † 1: Like “List: ... • first; ... • second; and ... • third.” Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-patch-id.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-patch-id.adoc b/Documentation/git-patch-id.adoc index 92a1af36a2..bac37db09d 100644 --- a/Documentation/git-patch-id.adoc +++ b/Documentation/git-patch-id.adoc @@ -45,7 +45,7 @@ This is the default if `patchid.verbatim` is `true`. with two different settings for `-O` result in the same patch ID signature, thereby allowing the computed result to be used as a key to index some meta-information about the change between - the two trees; + the two trees. - Result is different from the value produced by git 1.9 and older or produced when an "unstable" hash (see `--unstable` below) is From 92a61fe44dad03360141051180ace4aa39984abc Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Thu, 8 Jan 2026 07:28:16 +0100 Subject: [PATCH 2/6] doc: patch-id: capitalize Git version Git versions are always capitalized. Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-patch-id.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/git-patch-id.adoc b/Documentation/git-patch-id.adoc index bac37db09d..82992e35fc 100644 --- a/Documentation/git-patch-id.adoc +++ b/Documentation/git-patch-id.adoc @@ -47,7 +47,7 @@ This is the default if `patchid.verbatim` is `true`. as a key to index some meta-information about the change between the two trees. -- Result is different from the value produced by git 1.9 and older +- Result is different from the value produced by Git 1.9 and older or produced when an "unstable" hash (see `--unstable` below) is configured - even when used on a diff output taken without any use of `-O`, thereby making existing databases storing such @@ -61,8 +61,8 @@ This is the default if `patchid.stable` is set to `true`. `--unstable`:: Use an "unstable" hash as the patch ID. With this option, the result produced is compatible with the patch-id value produced - by git 1.9 and older and whitespace is ignored. Users with pre-existing - databases storing patch-ids produced by git 1.9 and older (who do not deal + by Git 1.9 and older and whitespace is ignored. Users with pre-existing + databases storing patch-ids produced by Git 1.9 and older (who do not deal with reordered patches) may want to use this option. + This is the default. From 285659cc983a60f89a60f96cff7397375766f3f8 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Thu, 8 Jan 2026 07:28:17 +0100 Subject: [PATCH 3/6] =?UTF-8?q?patch-id:=20use=20=E2=80=9Cpatch=20ID?= =?UTF-8?q?=E2=80=9D=20throughout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The “Description” section decided to introduce and use the term “patch ID” for the ID value itself. Let’s use the same term on the options as well. Also make to sure to use bare “ID” instead of “id”. Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-patch-id.adoc | 10 +++++----- builtin/patch-id.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/git-patch-id.adoc b/Documentation/git-patch-id.adoc index 82992e35fc..9999f164b5 100644 --- a/Documentation/git-patch-id.adoc +++ b/Documentation/git-patch-id.adoc @@ -31,7 +31,7 @@ OPTIONS ------- `--verbatim`:: - Calculate the patch-id of the input as it is given, do not strip + Calculate the patch ID of the input as it is given, do not strip any whitespace. + This is the default if `patchid.verbatim` is `true`. @@ -51,18 +51,18 @@ This is the default if `patchid.verbatim` is `true`. or produced when an "unstable" hash (see `--unstable` below) is configured - even when used on a diff output taken without any use of `-O`, thereby making existing databases storing such - "unstable" or historical patch-ids unusable. + "unstable" or historical patch IDs unusable. -- All whitespace within the patch is ignored and does not affect the id. +- All whitespace within the patch is ignored and does not affect the ID. -- + This is the default if `patchid.stable` is set to `true`. `--unstable`:: Use an "unstable" hash as the patch ID. With this option, - the result produced is compatible with the patch-id value produced + the result produced is compatible with the patch ID value produced by Git 1.9 and older and whitespace is ignored. Users with pre-existing - databases storing patch-ids produced by Git 1.9 and older (who do not deal + databases storing patch IDs produced by Git 1.9 and older (who do not deal with reordered patches) may want to use this option. + This is the default. diff --git a/builtin/patch-id.c b/builtin/patch-id.c index d26e9d0c1e..2781598ede 100644 --- a/builtin/patch-id.c +++ b/builtin/patch-id.c @@ -228,9 +228,9 @@ int cmd_patch_id(int argc, int opts = 0; struct option builtin_patch_id_options[] = { OPT_CMDMODE(0, "unstable", &opts, - N_("use the unstable patch-id algorithm"), 1), + N_("use the unstable patch ID algorithm"), 1), OPT_CMDMODE(0, "stable", &opts, - N_("use the stable patch-id algorithm"), 2), + N_("use the stable patch ID algorithm"), 2), OPT_CMDMODE(0, "verbatim", &opts, N_("don't strip whitespace from the patch"), 3), OPT_END() From f671f5a83b78643964bdfb75eb0aab54d23e25e9 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Thu, 8 Jan 2026 07:28:18 +0100 Subject: [PATCH 4/6] doc: patch-id: use definite article for the result Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-patch-id.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-patch-id.adoc b/Documentation/git-patch-id.adoc index 9999f164b5..abd02fccdc 100644 --- a/Documentation/git-patch-id.adoc +++ b/Documentation/git-patch-id.adoc @@ -47,7 +47,7 @@ This is the default if `patchid.verbatim` is `true`. as a key to index some meta-information about the change between the two trees. -- Result is different from the value produced by Git 1.9 and older +- The result is different from the value produced by Git 1.9 and older or produced when an "unstable" hash (see `--unstable` below) is configured - even when used on a diff output taken without any use of `-O`, thereby making existing databases storing such From 89d4f3af16a95fe1b6abe8c9f43fb7fb6826dadf Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Thu, 8 Jan 2026 07:28:19 +0100 Subject: [PATCH 5/6] doc: patch-id: spell out the git-diff-tree(1) form You specifically need `--patch` since the default output is a raw diff. Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-patch-id.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-patch-id.adoc b/Documentation/git-patch-id.adoc index abd02fccdc..61498def31 100644 --- a/Documentation/git-patch-id.adoc +++ b/Documentation/git-patch-id.adoc @@ -21,7 +21,7 @@ the same time also reasonably unique, i.e., two patches that have the same The main usecase for this command is to look for likely duplicate commits. -When dealing with `git diff-tree` output, it takes advantage of +When dealing with `git diff-tree --patch` output, it takes advantage of the fact that the patch is prefixed with the object name of the commit, and outputs two 40-byte hexadecimal strings. The first string is the patch ID, and the second string is the commit ID. From 3f051fc9c9f9e719ad0e37b66737b466b82d17b3 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Thu, 8 Jan 2026 07:28:20 +0100 Subject: [PATCH 6/6] doc: patch-id: --verbatim locks in --stable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default `--unstable` is a legacy format that predates `--stable`. That’s why 2871f4d4 (builtin: patch-id: add --verbatim as a command mode, 2022-10-24) made `--verbatim` lock in[1] `--stable`: Users of --unstable mainly care about compatibility with old git versions, which unstripping the whitespace would break. Thus there isn't a usecase for the combination of --verbatim and --unstable, and we don't expose this so as to not add maintainence burden. † 1: imply `--stable`, disallow `--unstable` Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-patch-id.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-patch-id.adoc b/Documentation/git-patch-id.adoc index 61498def31..013e1a6190 100644 --- a/Documentation/git-patch-id.adoc +++ b/Documentation/git-patch-id.adoc @@ -32,7 +32,7 @@ OPTIONS `--verbatim`:: Calculate the patch ID of the input as it is given, do not strip - any whitespace. + any whitespace. Implies `--stable` and forbids `--unstable`. + This is the default if `patchid.verbatim` is `true`.