I have about 40 git repositories, most of which have a .git-blame-ignore-revs
file for using with git blame
. So, instead of locally configuring each of them with blame.ignorerevsfile=.git-blame-ignore-revs
, I applied it to my global git config.
However, the few repositories which do not have such a file are impacted by it: running git blame
on them results in fatal: could not open object name list: .git-blame-ignore-revs
.
Is there a way to tell git to read such file if it exists, ignoring it otherwise? That would be ideal: simple to setup, yet unobtrusive if no such file exists.
Note: another reason why having an optional .git-blame-ignore-revs
file is useful, is that virtually all git repositories are created without such a file, and only later it is added. However, when bisecting old commits, we may end up returning to a point before the file exists, and then we have to touch
it, finish bisecting, then remove it again to be able to return to the HEAD commit. Even if I use a local config for the file, this extremely annoying situation will still happen. For that reason, I do believe the default behavior should be to ignore the file if it does not exist.