Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Have
git blame
only search back to upstream
We need to know if a line is blamed on the topic branch or upstream, but if it is blamed on upstream we don't care which commit exactly, so we can save `git blame` some work by telling it that the upstream commit doesn't have any parents via the `-S <revs-list>` option. Note that the manpage description of -S is wrong: it accepts a file of what git calls "grafts". These are described in commit 5da5c8f4cf4fb of the git repo as "fake commit parent records". From that commit message: > Each line of this file is a commit ID, followed by parent commit IDs, > all 40-byte hex SHA1 separated by a single SP in between. The records > override the parent information we would normally read from the commit > objects, allowing both adding "fake" parents (i.e. grafting), and > pretending as if a commit is not a child of some of its real parents > (i.e. cauterizing). Apparently the -S option was intended for internal use, which might explain why the manpage description is so misleading. From the comment on read_ancestry() in the git repo: > Add phony grafts for use with -S; this is primarily to support git's > cvsserver that wants to give a linear history to its clients. Using `git blame`'s --reverse option was investigated as a mechanism to save work, but it requires the path being blamed to exist in the starting commit, which won't always be the case for us. Closes #17
- Loading branch information