mgiuca@chromium.org | 8193756 | 2016-02-03 08:00:53 +0000 | [diff] [blame] | 1 | git-hyper-blame(1) |
| 2 | ================== |
| 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | git-hyper-blame - |
| 7 | include::_git-hyper-blame_desc.helper.txt[] |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
| 11 | [verse] |
mgiuca@chromium.org | cd0a1cf | 2016-02-22 00:40:33 +0000 | [diff] [blame] | 12 | 'git hyper-blame' [-i <rev> [-i <rev> ...]] [--ignore-file=<file>] |
| 13 | [--no-default-ignores] [<rev>] [--] <file> |
mgiuca@chromium.org | 8193756 | 2016-02-03 08:00:53 +0000 | [diff] [blame] | 14 | |
| 15 | DESCRIPTION |
| 16 | ----------- |
| 17 | |
| 18 | `git hyper-blame` is like `git blame` but it can ignore or "look through" a |
| 19 | given set of commits, to find the real culprit. |
| 20 | |
| 21 | This is useful if you have a commit that makes sweeping changes that are |
| 22 | unlikely to be what you are looking for in a blame, such as mass reformatting or |
| 23 | renaming. By adding these commits to the hyper-blame ignore list, `git |
| 24 | hyper-blame` will look past these commits to find the previous commit that |
| 25 | touched a given line. |
| 26 | |
| 27 | Follows the normal `blame` syntax: annotates `<file>` with the revision that |
| 28 | last modified each line. Optional `<rev>` specifies the revision of `<file>` to |
| 29 | start from. |
| 30 | |
mgiuca@chromium.org | cd0a1cf | 2016-02-22 00:40:33 +0000 | [diff] [blame] | 31 | Automatically looks for a file called `.git-blame-ignore-revs` in the repository |
| 32 | root directory. This file has the same syntax as the `--ignore-file` argument, |
| 33 | and any commits mentioned in this file are added to the ignore list. |
| 34 | |
mgiuca@chromium.org | 8193756 | 2016-02-03 08:00:53 +0000 | [diff] [blame] | 35 | OPTIONS |
| 36 | ------- |
| 37 | |
| 38 | -i <rev>:: |
| 39 | A revision to ignore. Can be specified as many times as needed. |
| 40 | |
mgiuca@chromium.org | cd0a1cf | 2016-02-22 00:40:33 +0000 | [diff] [blame] | 41 | --ignore-file=<file>:: |
| 42 | A file containing a list of revisions to ignore. Can have comments beginning |
| 43 | with `#`. |
| 44 | |
| 45 | --no-default-ignores:: |
| 46 | Do not ignore commits from the `.git-blame-ignore-revs` file. |
| 47 | |
mgiuca@chromium.org | 8193756 | 2016-02-03 08:00:53 +0000 | [diff] [blame] | 48 | EXAMPLE |
| 49 | ------- |
| 50 | |
| 51 | Let's run `git blame` on a file: |
| 52 | |
| 53 | demo:1[] |
| 54 | |
| 55 | Notice that almost the entire file has been blamed on a formatting change? You |
| 56 | aren't interested in the uppercasing of the file. You want to know who |
| 57 | wrote/modified those lines in the first place. Just tell `hyper-blame` to ignore |
| 58 | that commit: |
| 59 | |
| 60 | demo:2[] |
| 61 | |
| 62 | `hyper-blame` places a `*` next to any line where it has skipped over an ignored |
| 63 | commit, so you know that the line in question has been changed (by an ignored |
| 64 | commit) since the given person wrote it. |
| 65 | |
mgiuca@chromium.org | 01d2cde | 2016-02-05 03:25:41 +0000 | [diff] [blame] | 66 | CAVEATS |
| 67 | ------- |
| 68 | |
| 69 | When a line skips over an ignored commit, a guess is made as to which commit |
| 70 | previously modified that line, but it is not always clear where the line came |
| 71 | from. If the ignored commit makes lots of changes in close proximity, in |
| 72 | particular adding/removing/reordering lines, then the wrong authors may be |
| 73 | blamed for nearby edits. |
| 74 | |
| 75 | For this reason, `hyper-blame` works best when the ignored commits are be |
| 76 | limited to minor changes such as formatting and renaming, not refactoring or |
| 77 | other more invasive changes. |
| 78 | |
mgiuca@chromium.org | 8193756 | 2016-02-03 08:00:53 +0000 | [diff] [blame] | 79 | SEE ALSO |
| 80 | -------- |
| 81 | linkgit:git-blame[1] |
| 82 | |
| 83 | include::_footer.txt[] |
| 84 | |
| 85 | // vim: ft=asciidoc: |