Skip to contentSkip to conversation

align git diff a..b semantics with git log a..b

DISCUSSION Salikh Zakirov 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

Currently, git-diff accepts

git-diff A..B

syntax, and the output seems to be equivalent of 'git-diff A B'.

IMHO, this conflicts with A..B semantics defined for git-log family of commands. Consider following tree

O--X--Y--A1--A2 (a)

       \
        B1--B2  (b)

The command 'git log a..b' will show B1,B2, so I would find it intuitive (and useful) to have 'git diff a..b' show B1+B2, rather than -A2-A1+B1+B2.

So, I suggest to change semantics of 'git diff a..b' to 'git diff git-merge-base a b b'.

I could contribute the documentation change if the idea is accepted and implemented.

Thanks a lot!