Thread (8 messages) 8 messages, 6 authors, 2021-06-03

Re: git feature request: git blame --ignore-cleanup/--ignore-trivial

From: Taylor Blau <hidden>
Date: 2021-06-02 19:41:49
Also in: lkml

On Wed, Jun 02, 2021 at 03:29:44PM +0000, Al Viro wrote:
quoted
Any maybe the patterns associated to "cleanup" and "trivial" commits
should be something that can be configured through a git config
file.
Just an observation: quite a few subtle bugs arise from mistakes in
what should've been a trivial cleanup.  Hell, I've seen bugs coming
from rebase of provably no-op patches - with commit message unchanged.
So IME this is counterproductive...
Yes, I find excluding revisions from 'git blame' to be rarely useful,
exactly for this reason.

You could probably use the '--ignore-revs-file' option of 'git blame' to
exclude commits you consider trivial ahead of time. If you had an
'Is-trivial' trailer, I would probably do something like:

  $ git log --format='%H %(trailers:key=Is-trivial)' |
      grep "Is-trivial: true" | cut -d" " -f1 >exclude
  $ git blame --ignore-revs-file exclude ...

Thanks,
Taylor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help