I need to get list of commit ids between two known commits. I used the following command:
git show --format=format:%H --quiet commitA...commitB
It works flawlessly until there is a merge commit. I.e.:
* c36a37b
|\
| * 92187d9
* | e24d2c4
|/
* eef755e
The output is as follows:
$ git show --format=format:%H --quiet c36a37b...eef755e
c36a37b80caf2bae7b4833617443f4dfea8d8816
e24d2c4292baef4106976373ff3d01341834648d
92187d9a1002027c7d99824f2561467692bfd6b3
When I change the show
command and use log
instead:
$ git log --format=format:%H --quiet c36a37b...eef755e
c36a37b80caf2bae7b4833617443f4dfea8d8816
e24d2c4292baef4106976373ff3d01341834648d
92187d9a1002027c7d99824f2561467692bfd6b3
Notice there is no empty line after the first commit. I'm not fanatic about using git show
over git log
- I event don't remember where I got this idea from. But this extra empty line caused my program failure and I wonder if it has any special meaning.
Git version 1.9.5.