Is there a way to find all the commits in a repository that have a given parent?
I know many commits can have many parents. I want to find all commits that have a given parent. Since git write-tree
lets you specify parents when creating a commit, and the parents are then stored in the commit (git cat-file -p
lets you seem them quite plainly), I'd think that such a utility could brute force its way through the object store, test each object to see whether it is a commit, and if it is a commit, test whether any of its parents are the given commit.
In my case, I'm not even looking for performance—just results. And my repo is small.
The only similar question I've found is How to find all commits having a particular parent? That question is related to a Java library, and makes this seem way difficult. Is it?