SYNOPSIS
git hyper-blame [-i <rev> [-i <rev> …]] [<rev>] [--] <file>
DESCRIPTION
git hyper-blame
is like git blame
but it can ignore or "look through" a
given set of commits, to find the real culprit.
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.
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.
OPTIONS
- -i <rev>
-
A revision to ignore. Can be specified as many times as needed.
EXAMPLE
Let’s run git blame
on a file:
$ git blame ipsum.txt
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.
Notice that almost the entire file has been blamed on a formatting change? You
aren’t 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:
$ git hyper-blame -i 3ddda43c ipsum.txt
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.
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.
BUGS
-
When a commit is ignored, hyper-blame currently just blames the same line in the previous version of the file. This can be wildly inaccurate if the ignored commit adds or removes lines, resulting in a completely wrong commit being blamed.
-
There is currently no way to pass the ignore list as a file.
-
It should be possible for a git repository to configure an automatic list of commits to ignore (like
.gitignore
), so that project owners can maintain a list of "big change" commits that are ignored by hyper-blame by default.
SEE ALSO
CHROMIUM DEPOT_TOOLS
Part of the chromium depot_tools(7) suite. These tools are meant to assist with the development of chromium and related projects. Download the tools from here.