I need to get git commits from within a specific range, so I've been using
git log old_commit..new_commit
It works great apart when there was only 1 new commit added, and that old and new commit were either git commit -m ''
or git pull
For example:
commit XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Merge: XXXXXXY XXXXXXZ
Author: name <name@domain.com>
Date: Fri Nov 20 11:45:33 2015 +0200
Merge branch 'master' of xxxxxx.xx:xxxxxxx
commit XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXY
Author: name <name@domain.com>
Date: Fri Nov 20 11:45:05 2015 +0200
some commit message here
(Mind you the sequence could be in a different order - merge first then commit)
My point is, when I do:
git log XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXY..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
it behaves unexpectedly and instead of 1 (last) commit, it outputs a lot more others.
Am I doing something wrong? Are merges and commits considered as one or something?