Documentation/RelNotes/2.45.0.txt: fix typo
[git.git] / Documentation / git-patch-id.txt
blob1d15fa45d5126f236de4018268725c627c993fe2
1 git-patch-id(1)
2 ===============
4 NAME
5 ----
6 git-patch-id - Compute unique ID for a patch
8 SYNOPSIS
9 --------
10 [verse]
11 'git patch-id' [--stable | --unstable | --verbatim]
13 DESCRIPTION
14 -----------
15 Read a patch from the standard input and compute the patch ID for it.
17 A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a
18 patch, with line numbers ignored.  As such, it's "reasonably stable", but at
19 the same time also reasonably unique, i.e., two patches that have the same
20 "patch ID" are almost guaranteed to be the same thing.
22 The main usecase for this command is to look for likely duplicate commits.
24 When dealing with 'git diff-tree' output, it takes advantage of
25 the fact that the patch is prefixed with the object name of the
26 commit, and outputs two 40-byte hexadecimal strings.  The first
27 string is the patch ID, and the second string is the commit ID.
28 This can be used to make a mapping from patch ID to commit ID.
30 OPTIONS
31 -------
33 --verbatim::
34         Calculate the patch-id of the input as it is given, do not strip
35         any whitespace.
37         This is the default if patchid.verbatim is true.
39 --stable::
40         Use a "stable" sum of hashes as the patch ID. With this option:
41          - Reordering file diffs that make up a patch does not affect the ID.
42            In particular, two patches produced by comparing the same two trees
43            with two different settings for "-O<orderfile>" result in the same
44            patch ID signature, thereby allowing the computed result to be used
45            as a key to index some meta-information about the change between
46            the two trees;
48          - Result is different from the value produced by git 1.9 and older
49            or produced when an "unstable" hash (see --unstable below) is
50            configured - even when used on a diff output taken without any use
51            of "-O<orderfile>", thereby making existing databases storing such
52            "unstable" or historical patch-ids unusable.
54          - All whitespace within the patch is ignored and does not affect the id.
56         This is the default if patchid.stable is set to true.
58 --unstable::
59         Use an "unstable" hash as the patch ID. With this option,
60         the result produced is compatible with the patch-id value produced
61         by git 1.9 and older and whitespace is ignored.  Users with pre-existing
62         databases storing patch-ids produced by git 1.9 and older (who do not deal
63         with reordered patches) may want to use this option.
65         This is the default.
67 GIT
68 ---
69 Part of the linkgit:git[1] suite