Skip to content

Commit 3f2ecc4

Browse files
committed
Merge branch 'br/blame-ignore' into pu
"git blame" learned to "ignore" commits in the history, whose effects (as well as their presence) get ignored. * br/blame-ignore: blame: use a fingerprint heuristic to match ignored lines blame: optionally track line fingerprints during fill_blame_origin() blame: add config options to handle output for ignored lines blame: add the ability to ignore commits and their changes blame: use a helper function in blame_chunk() Move init_skiplist() outside of fsck
2 parents 2057c50 + dfb4ee1 commit 3f2ecc4

File tree

11 files changed

+740
-99
lines changed

11 files changed

+740
-99
lines changed

Documentation/blame-options.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,23 @@ 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 will be
120+
marked with a `*` in the blame output. If the
121+
`blame.maskIgnoredUnblamables` config option is set, then those lines that
122+
we could not attribute to another revision are outputted as all zeros.
123+
124+
--ignore-revs-file <file>::
125+
Ignore revisions listed in `file`, one unabbreviated object name per line.
126+
Whitespace and comments beginning with `#` are ignored. This option may be
127+
repeated, and these files will be processed after any files specified with
128+
the `blame.ignoreRevsFile` config option. An empty file name, `""`, will
129+
clear the list of revs from previously processed files.
130+
113131
-h::
114132
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.maskIgnoredUnblamables::
31+
Output an object hash of all zeros for lines that were changed by an ignored
32+
revision and that we could not attribute to another revision in the output
33+
of linkgit:git-blame[1].
34+
35+
blame.markIgnoredLines::
36+
Mark lines that were changed by an ignored revision with a '*' in the
37+
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)