I'm not sure there's a completely clean way to do what you want. But here's one suggestion... If you know that the set of branches you want to inspect is the one rooted at commit 3060fe0
, then you can use git branch --contains 3060fe0
to identify the potential branches, and use that to feed your git log
command. Something like:
git log ..... `git branch --contains 3060fe0`
But leave out the --all
option, as that would override your explicit branch selection...
For convenience, you could drop a tag on each tree root, like git tag tree1 3060fe0
, then you could just use git branch --contains tree1
.