Documentation / git-patch-id.txton commit Fourth batch for 2.1 (786a89d)
   1git-patch-id(1)
   2===============
   3
   4NAME
   5----
   6git-patch-id - Compute unique ID for a patch
   7
   8SYNOPSIS
   9--------
  10[verse]
  11'git patch-id' [--stable | --unstable] < <patch>
  12
  13DESCRIPTION
  14-----------
  15A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a
  16patch, with whitespace and line numbers ignored.  As such, it's "reasonably
  17stable", but at the same time also reasonably unique, i.e., two patches that
  18have the same "patch ID" are almost guaranteed to be the same thing.
  19
  20IOW, you can use this thing to look for likely duplicate commits.
  21
  22When dealing with 'git diff-tree' output, it takes advantage of
  23the fact that the patch is prefixed with the object name of the
  24commit, and outputs two 40-byte hexadecimal strings.  The first
  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
  28OPTIONS
  29-------
  30
  31--stable::
  32        Use a "stable" sum of hashes as the patch ID. With this option:
  33         - Reordering file diffs that make up a patch does not affect the ID.
  34           In particular, two patches produced by comparing the same two trees
  35           with two different settings for "-O<orderfile>" result in the same
  36           patch ID signature, thereby allowing the computed result to be used
  37           as a key to index some meta-information about the change between
  38           the two trees;
  39
  40         - Result is different from the value produced by git 1.9 and older
  41           or produced when an "unstable" hash (see --unstable below) is
  42           configured - even when used on a diff output taken without any use
  43           of "-O<orderfile>", thereby making existing databases storing such
  44           "unstable" or historical patch-ids unusable.
  45
  46        This is the default if patchid.stable is set to true.
  47
  48--unstable::
  49        Use an "unstable" hash as the patch ID. With this option,
  50        the result produced is compatible with the patch-id value produced
  51        by git 1.9 and older.  Users with pre-existing databases storing
  52        patch-ids produced by git 1.9 and older (who do not deal with reordered
  53        patches) may want to use this option.
  54
  55        This is the default.
  56
  57<patch>::
  58        The diff to create the ID of.
  59
  60GIT
  61---
  62Part of the linkgit:git[1] suite