The command git blame --ignore-revs-file .git-blame-ignore-revs add.txt works on a non-bare repository locally on my machine but when I get the bare repository for the same repository locally and try the same command, the following happens:
git blame --ignore-revs-file .git-blame-ignore-revs add.txt
fatal: could not open object name list: .git-blame-ignore-revs
Also noted that it works when we pass the same content in a copied file sitting somewhere else in the file system.
Eg: git blame --ignore-revs-file /tmp/.git-blame-ignore-revs add.txt works fine.
I thought this might be because its not able to find the path mentioned in bare repository and so I tried something like the following:
git blame --ignore-revs-file -- .git-blame-ignore-revs add.txt
but that resulted in :
fatal: bad revision '.git-blame-ignore-revs'
Could anyone help me understand how do we pass file paths to options in git command while running it against bare repositories? Or is it just not possible?
edit: ah. I get it. You want to use the committed version of that file. Repo content in a bare clone ordinarily never exists as a separate file, history is sent in packs. You have to ask git to show itself the contents of that committed file:
or for purity points, howitzer-proof futureproofing and a few microseconds of speed,
When I do this, it works:
and when I do
the error message is
fatal: no such path add.txt in HEAD.So I think your first test really didn't have that ignore list present.