1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
\r
4 <article lang="en" id="git-patch-id(1)">
\r
6 <title>git-patch-id(1)</title>
\r
8 <primary>git-patch-id(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-patch-id - Compute unique ID for a patch</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
17 <simpara><emphasis>git patch-id</emphasis> < <patch></simpara>
\r
19 <simplesect id="_description">
\r
20 <title>DESCRIPTION</title>
\r
21 <simpara>A "patch ID" is nothing but a SHA1 of the diff associated with a patch, with
\r
22 whitespace and line numbers ignored. As such, it’s "reasonably stable", but at
\r
23 the same time also reasonably unique, i.e., two patches that have the same "patch
\r
24 ID" are almost guaranteed to be the same thing.</simpara>
\r
25 <simpara>IOW, you can use this thing to look for likely duplicate commits.</simpara>
\r
26 <simpara>When dealing with <emphasis>git-diff-tree</emphasis> output, it takes advantage of
\r
27 the fact that the patch is prefixed with the object name of the
\r
28 commit, and outputs two 40-byte hexadecimal string. The first
\r
29 string is the patch ID, and the second string is the commit ID.
\r
30 This can be used to make a mapping from patch ID to commit ID.</simpara>
\r
32 <simplesect id="_options">
\r
33 <title>OPTIONS</title>
\r
41 The diff to create the ID of.
\r
47 <simplesect id="_author">
\r
48 <title>Author</title>
\r
49 <simpara>Written by Linus Torvalds <<ulink url="mailto:torvalds@osdl.org">torvalds@osdl.org</ulink>></simpara>
\r
51 <simplesect id="_documentation">
\r
52 <title>Documentation</title>
\r
53 <simpara>Documentation by Junio C Hamano and the git-list <<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>>.</simpara>
\r
55 <simplesect id="_git">
\r
57 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
\r