I have a short-lived process which does a shallow clone (e.g. git clone --depth 50 <repo>) of a huge repo with ancient history.
Part of the process, in some conditions, it uses runs git blame on certain lines of certain files. In some cases, where the line of the file was last changed in a very early commit of the repo, the git blame command takes a very long time. I think it lazy-downloads the history again and again until it reaches the old commit.
In my case, if the blame was not part of the shallow clone, I don't care about it.
Is there a way to limit git blame to the already downloaded commits and return an error message (or any other info I can parse) and not lazy-load older commits?
I tried using:
git blame -L 10,10 <SHA>^50..<SHA> -- file.txt
and
git blame -L 10,10 <SHA>~50..<SHA> -- file.txt
but in both cases I sometime get the following error:
fatal: bad revision
UPDATE: I failed to mention that I'm also using treeless --filter=tree:0
I get the following (repeating) messages in stderr:
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.