Skip to content

Commit 209f075

Browse files
committed
Merge branch 'br/blame-ignore'
"git blame" learned to "ignore" commits in the history, whose effects (as well as their presence) get ignored. * br/blame-ignore: t8014: remove unnecessary braces blame: drop some unused function parameters blame: add a test to cover blame_coalesce() blame: use the fingerprint heuristic to match ignored lines blame: add a fingerprint heuristic to match ignored lines blame: optionally track line fingerprints during fill_blame_origin() blame: add config options for the output of ignored or unblamable lines blame: add the ability to ignore commits and their changes blame: use a helper function in blame_chunk() Move oidset_parse_file() to oidset.c fsck: rename and touch up init_skiplist()
2 parents c62bff2 + 78fafbb commit 209f075

13 files changed

+1855
-99
lines changed

Documentation/blame-options.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,24 @@ commit. And the default value is 40. If there are more than one
110110
`-C` options given, the <num> argument of the last `-C` will
111111
take effect.
112112

113+
--ignore-rev <rev>::
114+
Ignore changes made by the revision when assigning blame, as if the
115+
change never happened. Lines that were changed or added by an ignored
116+
commit will be blamed on the previous commit that changed that line or
117+
nearby lines. This option may be specified multiple times to ignore
118+
more than one revision. If the `blame.markIgnoredLines` config option
119+
is set, then lines that were changed by an ignored commit and attributed to
120+
another commit will be marked with a `?` in the blame output. If the
121+
`blame.markUnblamableLines` config option is set, then those lines touched
122+
by an ignored commit that we could not attribute to another revision are
123+
marked with a '*'.
124+
125+
--ignore-revs-file <file>::
126+
Ignore revisions listed in `file`, which must be in the same format as an
127+
`fsck.skipList`. This option may be repeated, and these files will be
128+
processed after any files specified with the `blame.ignoreRevsFile` config
129+
option. An empty file name, `""`, will clear the list of revs from
130+
previously processed files.
131+
113132
-h::
114133
Show help message.

Documentation/config/blame.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,19 @@ blame.showEmail::
1919
blame.showRoot::
2020
Do not treat root commits as boundaries in linkgit:git-blame[1].
2121
This option defaults to false.
22+
23+
blame.ignoreRevsFile::
24+
Ignore revisions listed in the file, one unabbreviated object name per
25+
line, in linkgit:git-blame[1]. Whitespace and comments beginning with
26+
`#` are ignored. This option may be repeated multiple times. Empty
27+
file names will reset the list of ignored revisions. This option will
28+
be handled before the command line option `--ignore-revs-file`.
29+
30+
blame.markUnblamables::
31+
Mark lines that were changed by an ignored revision that we could not
32+
attribute to another commit with a '*' in the output of
33+
linkgit:git-blame[1].
34+
35+
blame.markIgnoredLines::
36+
Mark lines that were changed by an ignored revision that we attributed to
37+
another commit with a '?' in the output of linkgit:git-blame[1].

Documentation/git-blame.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ SYNOPSIS
1010
[verse]
1111
'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental]
1212
[-L <range>] [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>]
13+
[--ignore-rev <rev>] [--ignore-revs-file <file>]
1314
[--progress] [--abbrev=<n>] [<rev> | --contents <file> | --reverse <rev>..<rev>]
1415
[--] <file>
1516

0 commit comments

Comments
 (0)