]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-patch-id.txt
Merge branch 'jk/tag-contains-ab' (early part) into maint
[thirdparty/git.git] / Documentation / git-patch-id.txt
CommitLineData
7fc9d69f
JH
1git-patch-id(1)
2===============
3
4NAME
5----
c3f0baac 6git-patch-id - Compute unique ID for a patch
7fc9d69f
JH
7
8SYNOPSIS
9--------
7791a1d9 10[verse]
b1889c36 11'git patch-id' < <patch>
7fc9d69f
JH
12
13DESCRIPTION
14-----------
52a22d1e
LAS
15A "patch ID" is nothing but a SHA1 of the diff associated with a patch, with
16whitespace and line numbers ignored. As such, it's "reasonably stable", but at
abda1ef5 17the same time also reasonably unique, i.e., two patches that have the same "patch
52a22d1e 18ID" are almost guaranteed to be the same thing.
7fc9d69f 19
52a22d1e 20IOW, you can use this thing to look for likely duplicate commits.
7fc9d69f 21
0b444cdb 22When dealing with 'git diff-tree' output, it takes advantage of
a77a9222 23the fact that the patch is prefixed with the object name of the
4fa535a1 24commit, and outputs two 40-byte hexadecimal strings. The first
a77a9222
JH
25string is the patch ID, and the second string is the commit ID.
26This can be used to make a mapping from patch ID to commit ID.
27
7fc9d69f
JH
28OPTIONS
29-------
52a22d1e
LAS
30<patch>::
31 The diff to create the ID of.
7fc9d69f 32
7fc9d69f
JH
33GIT
34---
9e1f0a85 35Part of the linkgit:git[1] suite