git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
SZSalikh Zakirov <salikh.zakirov@intel.com>
Date
May 15, 2006, 08:41 UTC
Message-ID
<44683EBF.9070307@Intel.com>
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!
Message 1 of 1 in “align git diff a..b semantics with git log a..b”
  1. Salikh ZakirovMay 15, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.