Suppose I have the following branch structure:
E -- F (topic)
/
A -- B -- C -- D (master)
I have tried the following:
git diff master..topic
and
git diff master...topic
According to the gitrevisions documentation, the double-dot notation is supposed to include (in this case) only revisions in the topic
branch.
The way I visualize this is that when you use the master..topic
notation, think of moving from master
to topic
like moving a board piece in a board game. As you move to each node (commit) you only include the commits that involve moving the piece in a forward direction. Forward here is towards the tip of topic
, which means we include commits E and F.
Triple dot, in this case, is supposed to include commits in both branches. So this will be commits F, E, and D.
I expect the FIRST git diff above to show me commits E and F, but instead it shows me E, F, D (which should be triple-dot based on the rules above). The SECOND git diff shows me commits E and F when I expect it to show me E, F, G. Why are these behaving completely opposite? I understand that the git diff
documentation clearly states in the examples section that the triple-dot notation behaves as expected, but I suppose when you look at how git log
works and also the descriptions in the git revisions documentation, git diff
seems inconsistent and doesn't follow normal patterns.