I am writing an automated system to list commits between two commit references. Say I have 3 commits in chronological order such as:
- A
- B
- C
and I do git log --pretty=oneline A..C, I get the log as expected. However if I reverse the arguments, for example git log --pretty=oneline C..A, I get nothing. Is there no way git can be clever about the commit references?
If not, is there a way to determine if ref C should be after A in the argument list automatically?
You can run
git log A..Cgit log C..Amerge-basereturned their common ancestor