doc: patch-id: six small improvements
cover doc: patch-id: six small improvements
From: Kristoffer Haugsbakk <[email protected]>
Topic name: kh/doc-patch-id-3
Topic summary: Improvements to git-patch-id(1). Fix git-diff-tree(1) mention, Fix '--verbatim' documentation, and four other small improvements.
This is the third patch series for git-patch-id(1). This one only has small improvements.
• Patch series 1:
• Topic: kh/doc-patch-id-markup-fix
• https://lore.kernel.org/git/[email protected]/
• Patch series 2:
• Topic: kh/doc-patch-id-1
• https://lore.kernel.org/git/[email protected]/
Kristoffer Haugsbakk (6):
doc: patch-id: don’t use semicolon between bullet points
doc: patch-id: capitalize Git version
patch-id: use “patch ID” throughout
doc: patch-id: use definite article for the result
doc: patch-id: spell out the git-diff-tree(1) form
doc: patch-id: --verbatim locks in --stable
Documentation/git-patch-id.adoc | 20 ++++++++++---------- builtin/patch-id.c | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-)
base-commit: 9a2fb147f2c61d0cab52c883e7e26f5b7948e3ed
Signature · 1 line
2.52.0.421.gc32ead4fc78
PATCH 1/6 doc: patch-id: don’t use semicolon between bullet points
From: Kristoffer Haugsbakk <[email protected]>
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.”
--- Documentation/git-patch-id.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-patch-id.adoc +1 -1
@@ -45,7 +45,7 @@ This is the default if `patchid.verbatim` is `true`. with two different settings for `-O<orderfile>` 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
Signature · 1 line
2.52.0.421.gc32ead4fc78
PATCH 2/6 doc: patch-id: capitalize Git version
In reply to [email protected]From: Kristoffer Haugsbakk <[email protected]>
Git versions are always capitalized.
--- Documentation/git-patch-id.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/git-patch-id.adoc +3 -3
@@ -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<orderfile>`, 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.
Signature · 1 line
2.52.0.421.gc32ead4fc78
PATCH 3/6 patch-id: use “patch ID” throughout
In reply to [email protected]From: Kristoffer Haugsbakk <[email protected]>
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”.
--- Documentation/git-patch-id.adoc | 10 +++++----- builtin/patch-id.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-)
Documentation/git-patch-id.adoc +5 -5
@@ -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<orderfile>`, 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.
builtin/patch-id.c +2 -2
@@ -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 ()
Signature · 1 line
2.52.0.421.gc32ead4fc78
PATCH 4/6 doc: patch-id: use definite article for the result
In reply to [email protected]From: Kristoffer Haugsbakk <[email protected]>
--- Documentation/git-patch-id.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-patch-id.adoc +1 -1
@@ -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<orderfile>`, thereby making existing databases storing such
Signature · 1 line
2.52.0.421.gc32ead4fc78
PATCH 5/6 doc: patch-id: spell out the git-diff-tree(1) form
In reply to [email protected]From: Kristoffer Haugsbakk <[email protected]>
You specifically need --patch since the default output is a raw diff.
--- Documentation/git-patch-id.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-patch-id.adoc +1 -1
@@ -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.
Signature · 1 line
2.52.0.421.gc32ead4fc78
PATCH 6/6 doc: patch-id: --verbatim locks in --stable
In reply to [email protected]From: Kristoffer Haugsbakk <[email protected]>
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
--- Documentation/git-patch-id.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-patch-id.adoc +1 -1
@@ -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`.
Signature · 1 line
2.52.0.421.gc32ead4fc78
Re: [PATCH 6/6] doc: patch-id: --verbatim locks in --stable
Hi Kristoffer,
I read through the entire series and all six changes look correct to me.
Each patch is small and focused, and together they improve the clarity, consistency, and accuracy of the git-patch-id documentation without changing meaning. In particular, spelling out the git diff-tree --patch form and documenting the --verbatim / --stable relationship help align the docs more closely with the actual behavior and existing code.
I didn’t notice any issues with the changes.
Thanks for working on this,
Pushkar
Quoted 36 lines · On Thu, Jan 8, 2026 at 12:02 PM <[email protected]> wrote:
From: Kristoffer Haugsbakk <[email protected]>
The default
--unstableis a legacy format that predates--stable. That’s why2871f4d4(builtin: patch-id: add --verbatim as a command mode, 2022-10-24) made--verbatimlock 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 `--unstableSigned-off-by Kristoffer Haugsbakk <[email protected]>--- Documentation/git-patch-id.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/git-patch-id.adoc +1
-2@@ -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`. --2.52.0.421.gc32ead4fc78
Re: [PATCH 6/6] doc: patch-id: --verbatim locks in --stable
Quoted 8 lines · Pushkar Singh
I read through the entire series and all six changes look correct to me.
Each patch is small and focused, and together they improve the clarity, consistency, and accuracy of the git-patch-id documentation without changing meaning. In particular, spelling out the
git diff-tree --patchform and documenting the--verbatim/--stablerelationship help align the docs more closely with the actual behavior and existing code.
Quoted 4 lines
I didn’t notice any issues with the changes.
Thanks for working on this,
Pushkar
Hi Pushkar. Thanks for reviewing!
Re: [PATCH 6/6] doc: patch-id: --verbatim locks in --stable
In reply to [email protected]Quoted 6 lines · On Thu, Jan 8, 2026, at 07:28, [email protected] wrote:
From: Kristoffer Haugsbakk <[email protected]>
The default
--unstableis a legacy format that predates--stable. That’s why2871f4d4(builtin: patch-id: add --verbatim as a command mode, 2022-10-24) made--verbatimlock in[1]--stable:
Quoted 6 lines
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
s/--unstable/--unstable`/
Quoted 4 lines
Signed-off-by Kristoffer Haugsbakk <[email protected]>---
[snip]
Quoted 10 lines · On Thu, Jan 08, 2026 at 07:28:14AM +0100, [email protected]…
From: Kristoffer Haugsbakk <[email protected]>
Topic name: kh/doc-patch-id-3
Topic summary: Improvements to git-patch-id(1). Fix git-diff-tree(1) mention, Fix '--verbatim' documentation, and four other small improvements.
This is the third patch series for git-patch-id(1). This one only has small improvements.
Except for the small nit that you yourself noticed on the last patch all of these patches look like obvious improvements to me. Thanks!
Patrick
Quoted 5 lines · Patrick Steinhardt
Quoted 1 line · On Thu, Jan 08, 2026 at 07:28:14AM +0100, [email protected]…
[snip]
Except for the small nit that you yourself noticed on the last patch all of these patches look like obvious improvements to me. Thanks!
Thanks for taking a look! I should get around to making a second version with that nit removed today. :)
v2 cover doc: patch-id: six small improvements
In reply to [email protected]From: Kristoffer Haugsbakk <[email protected]>
Topic name: kh/doc-patch-id-3
Topic summary: Improvements to git-patch-id(1). Fix git-diff-tree(1) mention, Fix '--verbatim' documentation, and four other small improvements.
This is the third patch series for git-patch-id(1). This one only has small improvements.
• Patch series 1:
• Topic: kh/doc-patch-id-markup-fix
• https://lore.kernel.org/git/[email protected]/
• Patch series 2:
• Topic: kh/doc-patch-id-1
• https://lore.kernel.org/git/[email protected]/
§ Changtes in v2
Fix markup in commit message.
Kristoffer Haugsbakk (6):
doc: patch-id: don’t use semicolon between bullet points
doc: patch-id: capitalize Git version
patch-id: use “patch ID” throughout
doc: patch-id: use definite article for the result
doc: patch-id: spell out the git-diff-tree(1) form
doc: patch-id: --verbatim locks in --stable
Documentation/git-patch-id.adoc | 20 ++++++++++---------- builtin/patch-id.c | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-)
Interdiff against v1:
Range-diff against v1:
1: b3883b32d26 = 1: b3883b32d26 doc: patch-id: don’t use semicolon between bullet points 2: d96ab8edb3f = 2: d96ab8edb3f doc: patch-id: capitalize Git version 3: f7f249d79ce = 3: f7f249d79ce patch-id: use “patch ID” throughout 4: 28c11153e6a = 4: 28c11153e6a doc: patch-id: use definite article for the result 5: 463c6c60ec6 = 5: 463c6c60ec6 doc: patch-id: spell out the git-diff-tree(1) form 6: 03cc19de8da ! 6: 0b5c10f143e doc: patch-id: --verbatim locks in --stable
@@ Commit message
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
+ † 1: imply --stable, disallow --unstable
+
+ ## Notes (series) ##
+ v2:
+ Fix “markup” in commit message: --unstable.
+
## Documentation/git-patch-id.adoc ##
@@ Documentation/git-patch-id.adoc: OPTIONS
base-commit: 9a2fb147f2c61d0cab52c883e7e26f5b7948e3ed
Signature · 1 line
2.52.0.421.gc32ead4fc78
PATCH v2 1/6 doc: patch-id: don’t use semicolon between bullet points
From: Kristoffer Haugsbakk <[email protected]>
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.”
--- Documentation/git-patch-id.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-patch-id.adoc +1 -1
@@ -45,7 +45,7 @@ This is the default if `patchid.verbatim` is `true`. with two different settings for `-O<orderfile>` 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
Signature · 1 line
2.52.0.421.gc32ead4fc78
PATCH v2 2/6 doc: patch-id: capitalize Git version
In reply to [email protected]From: Kristoffer Haugsbakk <[email protected]>
Git versions are always capitalized.
--- Documentation/git-patch-id.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/git-patch-id.adoc +3 -3
@@ -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<orderfile>`, 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.
Signature · 1 line
2.52.0.421.gc32ead4fc78
PATCH v2 3/6 patch-id: use “patch ID” throughout
In reply to [email protected]From: Kristoffer Haugsbakk <[email protected]>
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”.
--- Documentation/git-patch-id.adoc | 10 +++++----- builtin/patch-id.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-)
Documentation/git-patch-id.adoc +5 -5
@@ -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<orderfile>`, 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.
builtin/patch-id.c +2 -2
@@ -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 ()
Signature · 1 line
2.52.0.421.gc32ead4fc78
PATCH v2 4/6 doc: patch-id: use definite article for the result
In reply to [email protected]From: Kristoffer Haugsbakk <[email protected]>
--- Documentation/git-patch-id.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-patch-id.adoc +1 -1
@@ -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<orderfile>`, thereby making existing databases storing such
Signature · 1 line
2.52.0.421.gc32ead4fc78
PATCH v2 5/6 doc: patch-id: spell out the git-diff-tree(1) form
In reply to [email protected]From: Kristoffer Haugsbakk <[email protected]>
You specifically need --patch since the default output is a raw diff.
--- Documentation/git-patch-id.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-patch-id.adoc +1 -1
@@ -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.
Signature · 1 line
2.52.0.421.gc32ead4fc78
PATCH v2 6/6 doc: patch-id: --verbatim locks in --stable
In reply to [email protected]From: Kristoffer Haugsbakk <[email protected]>
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
---
Notes (series):
v2:
Fix “markup” in commit message: --unstable.
Documentation/git-patch-id.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-patch-id.adoc +1 -1
@@ -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`.
Signature · 1 line
2.52.0.421.gc32ead4fc78
Quoted 18 lines · On Fri, Jan 09, 2026 at 03:25:56PM +0100, [email protected]…
From: Kristoffer Haugsbakk <[email protected]>
Topic name: kh/doc-patch-id-3
Topic summary: Improvements to git-patch-id(1). Fix git-diff-tree(1) mention, Fix '--verbatim' documentation, and four other small improvements.
This is the third patch series for git-patch-id(1). This one only has small improvements.
• Patch series 1:
• Topic: kh/doc-patch-id-markup-fix
• https://lore.kernel.org/git/[email protected]/
• Patch series 2:
• Topic: kh/doc-patch-id-1
• https://lore.kernel.org/git/[email protected]/
Quoted 3 lines
§ Changtes in v2
Fix markup in commit message.
This version looks good to me based on the range-diff, thanks!
Patrick