$ git-rev-list A B --not $(git-merge-base --all A B) +$ git-rev-list A...B+
From: Junio C Hamano
A special notation <commit1>..<commit2> can be used as a short-hand for ^<commit1> <commit2>.
+Another special notation is <commit1>…<commit2> which is useful for +merges. The resulting set of commits is the symmetric difference +between the two operands. The following two commands are equivalent:
+$ git-rev-list A B --not $(git-merge-base --all A B) +$ git-rev-list A...B+
+ Reverses the meaning of the ^ prefix (or lack + thereof) for all following revision specifiers, up to + the next --not. +
+