+3

Blame/Investigate: allow specifying a list of revisions for git blame to ignore

griscom 5 months ago updated by janner 4 weeks ago 3

A classic problem in large repositories is when someone reformats the code, touching most lines in every file. This makes git blame a lot less useful, as all roads lead to Rome (the revision where the reformatting was done).

git blame, however, can ignore a list of revisions:

> git blame --ignore-revs-file .git-blame-ignore-revs

Adding this to SmartGit's Blame and Investigate views would be very handy.

Both, Blame and Investigate are dialog-less operations and should stay so; adding some menu item like "Recompare with blame-ignore-revs" also isn't elegant. But I agree that Blame and Investigate should honor "blame.ignoreRevsFile" configuration.

Note that the overall problem seems to be less pressing for SmartGit because both, Blame and Investigate, already allow to go to the previous line once you find yourself located at a reformat commit.

Clearly there shouldn't be a new, intermediate dialog whenever you choose Blame or Investigate.

So, two options:

  • Have SmartGit respect the presence of a ".git-blame-ignore-revs" file at the top level (perhaps enabled by a config value)
  • Have an "Ignore this revision" context menu choice that, when chosen, recalculates the Blame or Investigate's display without the chosen revision. The next time you open that revision's context menu, there's a checkmark next to the item; choose it again and the ignoring goes away. (Where would this config be stored?)

I would really appreciate if SmartGit would honor theblame.ignoreRevsFile config.

As someone who frequently does bulk reformat changes in our repos I'm always held responsible for all the bad things my team commits.
Also I noticed that during a blame people just read committer, they never read the commit message :-(