You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
depot_tools/man/man1/git-hyper-blame.1

129 lines
5.4 KiB
Groff

'\" t
.\" Title: git-hyper-blame
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 05/03/2019
.\" Manual: Chromium depot_tools Manual
.\" Source: depot_tools e58cce6c
.\" Language: English
.\"
.TH "GIT\-HYPER\-BLAME" "1" "05/03/2019" "depot_tools e58cce6c" "Chromium depot_tools 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-hyper-blame \- Like git blame, but with the ability to ignore or bypass certain commits\&.
.SH "SYNOPSIS"
.sp
.nf
git hyper-blame: Added automatically ignoring revs from a file. Added --ignore-file argument, so you can specify ignored commits in a file rather than as raw command-line arguments. Also, automatically searches for a file called .git-blame-ignore-revs, which is automatically used as an ignore list by default. Also, specifying an unknown revision (either on the command line or in a file) now generates a warning, not an error. Notes on some decisions: - The file is called .git-blame-ignore-revs (not mentioning hyper-blame) because we may use the same list in tools other than hyper-blame in the future. - We look at the *currently checked out* version of .git-blame-ignore-revs (not the version at the specified revision) for consistency with .git-ignore. Because we only expect revisions to be added (not deleted), it should be fine to use an ignore list from a newer version than the revision being blamed. - We considered using git notes for the ignore list so that you could add a revision to the ignore list without needing a follow-up CL. However, there are some problems with this approach. git notes is not automatically synced with git clone/pull. Also the Chromium infra tools (Reitveld, CQ) are not set up to allow modification of git notes, nor are changes to git notes subject to OWNERS checks. Using a regular file ensures all users synced to a particular revision are using the same ignore list. BUG=574290 Review URL: https://codereview.chromium.org/1697423004 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298897 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
\fIgit hyper\-blame\fR [\-i <rev> [\-i <rev> \&...]] [\-\-ignore\-file=<file>]
[\-\-no\-default\-ignores] [<rev>] [\-\-] <file>
.fi
.sp
.SH "DESCRIPTION"
.sp
git hyper\-blame is like git blame but it can ignore or "look through" a given set of commits, to find the real culprit\&.
.sp
This is useful if you have a commit that makes sweeping changes that are unlikely to be what you are looking for in a blame, such as mass reformatting or renaming\&. By adding these commits to the hyper\-blame ignore list, git hyper\-blame will look past these commits to find the previous commit that touched a given line\&.
.sp
Follows the normal blame syntax: annotates <file> with the revision that last modified each line\&. Optional <rev> specifies the revision of <file> to start from\&.
git hyper-blame: Added automatically ignoring revs from a file. Added --ignore-file argument, so you can specify ignored commits in a file rather than as raw command-line arguments. Also, automatically searches for a file called .git-blame-ignore-revs, which is automatically used as an ignore list by default. Also, specifying an unknown revision (either on the command line or in a file) now generates a warning, not an error. Notes on some decisions: - The file is called .git-blame-ignore-revs (not mentioning hyper-blame) because we may use the same list in tools other than hyper-blame in the future. - We look at the *currently checked out* version of .git-blame-ignore-revs (not the version at the specified revision) for consistency with .git-ignore. Because we only expect revisions to be added (not deleted), it should be fine to use an ignore list from a newer version than the revision being blamed. - We considered using git notes for the ignore list so that you could add a revision to the ignore list without needing a follow-up CL. However, there are some problems with this approach. git notes is not automatically synced with git clone/pull. Also the Chromium infra tools (Reitveld, CQ) are not set up to allow modification of git notes, nor are changes to git notes subject to OWNERS checks. Using a regular file ensures all users synced to a particular revision are using the same ignore list. BUG=574290 Review URL: https://codereview.chromium.org/1697423004 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298897 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
.sp
Automatically looks for a file called \&.git\-blame\-ignore\-revs in the repository root directory\&. This file has the same syntax as the \-\-ignore\-file argument, and any commits mentioned in this file are added to the ignore list\&.
.SH "OPTIONS"
.PP
\-i <rev>
.RS 4
A revision to ignore\&. Can be specified as many times as needed\&.
.RE
git hyper-blame: Added automatically ignoring revs from a file. Added --ignore-file argument, so you can specify ignored commits in a file rather than as raw command-line arguments. Also, automatically searches for a file called .git-blame-ignore-revs, which is automatically used as an ignore list by default. Also, specifying an unknown revision (either on the command line or in a file) now generates a warning, not an error. Notes on some decisions: - The file is called .git-blame-ignore-revs (not mentioning hyper-blame) because we may use the same list in tools other than hyper-blame in the future. - We look at the *currently checked out* version of .git-blame-ignore-revs (not the version at the specified revision) for consistency with .git-ignore. Because we only expect revisions to be added (not deleted), it should be fine to use an ignore list from a newer version than the revision being blamed. - We considered using git notes for the ignore list so that you could add a revision to the ignore list without needing a follow-up CL. However, there are some problems with this approach. git notes is not automatically synced with git clone/pull. Also the Chromium infra tools (Reitveld, CQ) are not set up to allow modification of git notes, nor are changes to git notes subject to OWNERS checks. Using a regular file ensures all users synced to a particular revision are using the same ignore list. BUG=574290 Review URL: https://codereview.chromium.org/1697423004 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298897 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
.PP
\-\-ignore\-file=<file>
.RS 4
A file containing a list of revisions to ignore\&. Can have comments beginning with
#\&.
.RE
.PP
\-\-no\-default\-ignores
.RS 4
Do not ignore commits from the
\&.git\-blame\-ignore\-revs
file\&.
.RE
.SH "EXAMPLE"
.sp
Let\(cqs run git blame on a file:
.sp
.sp
.if n \{\
.RS 4
.\}
.nf
\fB$ git blame ipsum\&.txt\fR
c6eb3bfa (lorem 2014\-08\-11 23:15:57 +0000 1) LOREM IPSUM DOLOR SIT AMET, CONSECTETUR
3ddda43c (auto\-uppercaser 2014\-07\-05 02:05:18 +0000 2) ADIPISCING ELIT, SED DO EIUSMOD TEMPOR
3ddda43c (auto\-uppercaser 2014\-07\-05 02:05:18 +0000 3) INCIDIDUNT UT LABORE ET DOLORE MAGNA
3ddda43c (auto\-uppercaser 2014\-07\-05 02:05:18 +0000 4) ALIQUA\&. UT ENIM AD MINIM VENIAM, QUIS
c6eb3bfa (lorem 2014\-08\-11 23:15:57 +0000 5) NOSTRUD EXERCITATION ULLAMCO LABORIS
3ddda43c (auto\-uppercaser 2014\-07\-05 02:05:18 +0000 6) NISI UT ALIQUIP EX EA COMMODO CONSEQUAT\&.
.fi
.if n \{\
.RE
.\}
.sp
.sp
Notice that almost the entire file has been blamed on a formatting change? You aren\(cqt interested in the uppercasing of the file\&. You want to know who wrote/modified those lines in the first place\&. Just tell hyper\-blame to ignore that commit:
.sp
.sp
.if n \{\
.RS 4
.\}
.nf
\fB$ git hyper\-blame \-i 3ddda43c ipsum\&.txt\fR
c6eb3bfa (lorem 2014\-08\-11 23:15:57 +0000 1) LOREM IPSUM DOLOR SIT AMET, CONSECTETUR
134200d1 (lorem 2014\-04\-10 08:54:46 +0000 2*) ADIPISCING ELIT, SED DO EIUSMOD TEMPOR
a34a1d0d (ipsum 2014\-04\-11 11:25:04 +0000 3*) INCIDIDUNT UT LABORE ET DOLORE MAGNA
134200d1 (lorem 2014\-04\-10 08:54:46 +0000 4*) ALIQUA\&. UT ENIM AD MINIM VENIAM, QUIS
c6eb3bfa (lorem 2014\-08\-11 23:15:57 +0000 5) NOSTRUD EXERCITATION ULLAMCO LABORIS
0f0d17bd (dolor 2014\-06\-02 11:31:48 +0000 6*) NISI UT ALIQUIP EX EA COMMODO CONSEQUAT\&.
.fi
.if n \{\
.RE
.\}
.sp
.sp
hyper\-blame places a * next to any line where it has skipped over an ignored commit, so you know that the line in question has been changed (by an ignored commit) since the given person wrote it\&.
.SH "CAVEATS"
.sp
When a line skips over an ignored commit, a guess is made as to which commit previously modified that line, but it is not always clear where the line came from\&. If the ignored commit makes lots of changes in close proximity, in particular adding/removing/reordering lines, then the wrong authors may be blamed for nearby edits\&.
.sp
For this reason, hyper\-blame works best when the ignored commits are be limited to minor changes such as formatting and renaming, not refactoring or other more invasive changes\&.
.SH "SEE ALSO"
.sp
\fBgit-blame\fR(1)
.SH "CHROMIUM DEPOT_TOOLS"
.sp
Part of the chromium \fBdepot_tools\fR(7) suite\&. These tools are meant to assist with the development of chromium and related projects\&. Download the tools from \m[blue]\fBhere\fR\m[]\&\s-2\u[1]\d\s+2\&.
.SH "NOTES"
.IP " 1." 4
here
.RS 4
\%https://chromium.googlesource.com/chromium/tools/depot_tools.git
.RE