summaryrefslogtreecommitdiff
path: root/devdocs/git/git-patch-id.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/git/git-patch-id.html
new repository
Diffstat (limited to 'devdocs/git/git-patch-id.html')
-rw-r--r--devdocs/git/git-patch-id.html6
1 files changed, 6 insertions, 0 deletions
diff --git a/devdocs/git/git-patch-id.html b/devdocs/git/git-patch-id.html
new file mode 100644
index 00000000..2e7ffa3d
--- /dev/null
+++ b/devdocs/git/git-patch-id.html
@@ -0,0 +1,6 @@
+<h1>git-patch-id</h1> <h2 id="_name">Name</h2> <div class="sectionbody"> <p>git-patch-id - Compute unique ID for a patch</p> </div> <h2 id="_synopsis">Synopsis</h2> <div class="sectionbody"> <div class="verseblock"> <pre class="content" data-language="shell">git patch-id [--stable | --unstable | --verbatim]</pre> </div> </div> <h2 id="_description">Description</h2> <div class="sectionbody"> <p>Read a patch from the standard input and compute the patch ID for it.</p> <p>A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a patch, with line numbers ignored. As such, it’s "reasonably stable", but at the same time also reasonably unique, i.e., two patches that have the same "patch ID" are almost guaranteed to be the same thing.</p> <p>The main usecase for this command is to look for likely duplicate commits.</p> <p>When dealing with <code>git diff-tree</code> 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. This can be used to make a mapping from patch ID to commit ID.</p> </div> <h2 id="_options">Options</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-patch-id.txt---verbatim"> --verbatim </dt> <dd> <p>Calculate the patch-id of the input as it is given, do not strip any whitespace.</p> <div class="literalblock"> <div class="content"> <pre>This is the default if patchid.verbatim is true.</pre> </div> </div> </dd> <dt class="hdlist1" id="Documentation/git-patch-id.txt---stable"> --stable </dt> <dd> <p>Use a "stable" sum of hashes as the patch ID. With this option:</p> <div class="ulist"> <ul> <li> <p>Reordering file diffs that make up a patch does not affect the ID. In particular, two patches produced by comparing the same two trees with two different settings for "-O&lt;orderfile&gt;" 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;</p> </li> <li> <p>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&lt;orderfile&gt;", thereby making existing databases storing such "unstable" or historical patch-ids unusable.</p> </li> <li> <p>All whitespace within the patch is ignored and does not affect the id.</p> <div class="literalblock"> <div class="content"> <pre>This is the default if patchid.stable is set to true.</pre> </div> </div> </li> </ul> </div> </dd> <dt class="hdlist1" id="Documentation/git-patch-id.txt---unstable"> --unstable </dt> <dd> <p>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 with reordered patches) may want to use this option.</p> <div class="literalblock"> <div class="content"> <pre>This is the default.</pre> </div> </div> </dd> </dl> </div> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2012&ndash;2024 Scott Chacon and others<br>Licensed under the MIT License.<br>
+ <a href="https://git-scm.com/docs/git-patch-id" class="_attribution-link">https://git-scm.com/docs/git-patch-id</a>
+ </p>
+</div>