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.75.2 <http://docbook.sf.net/>
.\"      Date: 06/01/2011
.\"    Manual: Git Manual
.\"    Source: Git 1.7.5.4
.\"  Language: English
.\"
.TH "GIT\-PATCH\-ID" "1" "06/01/2011" "Git 1\&.7\&.5\&.4" "Git Manual"
.\" -----------------------------------------------------------------
.\" * 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
\fIgit patch\-id\fR < <patch>
.SH "DESCRIPTION"
.sp
A "patch ID" is nothing but a SHA1 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