threads / discuss / 4144

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

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

## tl;dr

One message between May 15, 2006 and May 15, 2006.

replies: 0people: 1as markdown or json

Salikh Zakirov· May 15, 2006, 08:41 UTC · lore
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!

← back to recent threads