git-patch-id.1   [plain text]


'\" t
.\"     Title: git-patch-id
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: 02/24/2014
.\"    Manual: Git Manual
.\"    Source: Git 1.9.0
.\"  Language: English
.\"
.TH "GIT\-PATCH\-ID" "1" "02/24/2014" "Git 1\&.9\&.0" "Git Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
git-patch-id \- Compute unique ID for a patch
.SH "SYNOPSIS"
.sp
.nf
\fIgit patch\-id\fR < <patch>
.fi
.sp
.SH "DESCRIPTION"
.sp
A "patch ID" is nothing but a SHA\-1 of the diff associated with a patch, with whitespace and line numbers ignored\&. As such, it\(cqs "reasonably stable", but at the same time also reasonably unique, i\&.e\&., two patches that have the same "patch ID" are almost guaranteed to be the same thing\&.
.sp
IOW, you can use this thing to look for likely duplicate commits\&.
.sp
When dealing with \fIgit diff\-tree\fR output, it takes advantage of the fact that the patch is prefixed with the object name of the commit, and outputs two 40\-byte hexadecimal strings\&. The first string is the patch ID, and the second string is the commit ID\&. This can be used to make a mapping from patch ID to commit ID\&.
.SH "OPTIONS"
.PP
<patch>
.RS 4
The diff to create the ID of\&.
.RE
.SH "GIT"
.sp
Part of the \fBgit\fR(1) suite