With Git you can list all ancestors of b, excluding all ancestors of a:
git log a..b
You can also list all first-parent ancestors of b, excluding all ancestors of a:
git log --first-parent a..b
But I want to list all first-parent ancestors of b, excluding all first-parent ancestors of a. I haven't found any way to get the first-parent requirement to also apply to the negative part(s) of a revision range.
Is there a way to do this? If there's no way to do this using only Git commands, is there a plausible way to achieve this with a Bash script?
Some more detail. For this commit graph (parents shown in left-to-right order):
b --> 9
|\
| \
| \
a --> 6 7 8
|\ | |
| \ | |
| \| |
3 4 5
\ | /
\ | /
\|/
2
|
|
1
git log a..b would list 9, 8, 7 and 5. git log --first-parent a..b would list 9 and 7. I'm looking for a way to list 9, 7 and 4.