Update git documentation
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-patch-id.xml
blob735a6c6657575c76ab363a2146f509d40f4f6565
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">\r
3 \r
4 <sect2 lang="en" id="git-patch-id(1)">\r
5     <title>git-patch-id(1)</title>\r
6 <indexterm>\r
7 <primary>git-patch-id(1)</primary>\r
8 </indexterm>\r
9 <simplesect id="git-patch-id(1)__name">\r
10 <title>NAME</title>\r
11 <simpara>git-patch-id - Compute unique ID for a patch</simpara>\r
12 </simplesect>\r
13 <simplesect id="git-patch-id(1)__synopsis">\r
14 <title>SYNOPSIS</title>\r
15 <blockquote>\r
16 <literallayout><emphasis>git patch-id</emphasis> [--stable | --unstable]</literallayout>\r
17 </blockquote>\r
18 </simplesect>\r
19 <simplesect id="git-patch-id(1)__description">\r
20 <title>DESCRIPTION</title>\r
21 <simpara>Read a patch from the standard input and compute the patch ID for it.</simpara>\r
22 <simpara>A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a\r
23 patch, with whitespace and line numbers ignored.  As such, it's "reasonably\r
24 stable", but at the same time also reasonably unique, i.e., two patches that\r
25 have the same "patch ID" are almost guaranteed to be the same thing.</simpara>\r
26 <simpara>IOW, you can use this thing to look for likely duplicate commits.</simpara>\r
27 <simpara>When dealing with <emphasis>git diff-tree</emphasis> output, it takes advantage of\r
28 the fact that the patch is prefixed with the object name of the\r
29 commit, and outputs two 40-byte hexadecimal strings.  The first\r
30 string is the patch ID, and the second string is the commit ID.\r
31 This can be used to make a mapping from patch ID to commit ID.</simpara>\r
32 </simplesect>\r
33 <simplesect id="git-patch-id(1)__options">\r
34 <title>OPTIONS</title>\r
35 <variablelist>\r
36 <varlistentry>\r
37 <term>\r
38 --stable\r
39 </term>\r
40 <listitem>\r
41 <simpara>\r
42         Use a "stable" sum of hashes as the patch ID. With this option:\r
43 </simpara>\r
44 <itemizedlist>\r
45 <listitem>\r
46 <simpara>\r
47 Reordering file diffs that make up a patch does not affect the ID.\r
48            In particular, two patches produced by comparing the same two trees\r
49            with two different settings for "-O&lt;orderfile&gt;" result in the same\r
50            patch ID signature, thereby allowing the computed result to be used\r
51            as a key to index some meta-information about the change between\r
52            the two trees;\r
53 </simpara>\r
54 </listitem>\r
55 <listitem>\r
56 <simpara>\r
57 Result is different from the value produced by git 1.9 and older\r
58            or produced when an "unstable" hash (see --unstable below) is\r
59            configured - even when used on a diff output taken without any use\r
60            of "-O&lt;orderfile&gt;", thereby making existing databases storing such\r
61            "unstable" or historical patch-ids unusable.\r
62 </simpara>\r
63 <literallayout class="monospaced">This is the default if patchid.stable is set to true.</literallayout>\r
64 </listitem>\r
65 </itemizedlist>\r
66 </listitem>\r
67 </varlistentry>\r
68 <varlistentry>\r
69 <term>\r
70 --unstable\r
71 </term>\r
72 <listitem>\r
73 <simpara>\r
74         Use an "unstable" hash as the patch ID. With this option,\r
75         the result produced is compatible with the patch-id value produced\r
76         by git 1.9 and older.  Users with pre-existing databases storing\r
77         patch-ids produced by git 1.9 and older (who do not deal with reordered\r
78         patches) may want to use this option.\r
79 </simpara>\r
80 <literallayout class="monospaced">This is the default.</literallayout>\r
81 </listitem>\r
82 </varlistentry>\r
83 <varlistentry>\r
84 <term>\r
85 &lt;patch&gt;\r
86 </term>\r
87 <listitem>\r
88 <simpara>\r
89         The diff to create the ID of.\r
90 </simpara>\r
91 </listitem>\r
92 </varlistentry>\r
93 </variablelist>\r
94 </simplesect>\r
95 <simplesect id="git-patch-id(1)__git">\r
96 <title>GIT</title>\r
97 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
98 </simplesect>\r
99 </sect2>\r