I trying to build a git log command to show commits reachable from commit1 but not reachable from a set of other commits (commit2 ...). However I seem to be doing something wrong with a command to exclude those reachable from just one (commit2) using the ^ prefix notation and I hope somebody can show me what I've got wrong.
I'm successfully using the ".." revision range syntax. It correctly returns 2 commits as shown below:
>git log 349ef28..4b58345 --pretty="format:%H"
4b58345764e1527ce150e1b31bb722130e018651
eaf22be216276964d5c07ca9196c6ab48041b046
But when I use the ^ prefix fails, it just lists everything. I expected both to return the same two commit SHAs.
>git log ^349ef28 4b58345 --pretty="format:%H"
4b58345764e1527ce150e1b31bb722130e018651
eaf22be216276964d5c07ca9196c6ab48041b046
349ef283776d6c5374894bcc571267a0bee24fd5
aeb1fd3b65fe9c82bad839bd9f34e0bc2603290d
aef60d126e5ea756ef44cccb43cda28044a560ed
:
I've tried:
- Using full SHA
- Reversing the order of commits on the command line
- Without any formatting
- I've even read the documentation (but obviously I've missed something)
What am I doing wrong?
Updated: Replaced image with text as requested.
--graph?