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

Re: Mismatch meaning between git-diff and git-log for the .. (double dot notation) and ... (triple dot notation)

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Dec 23, 2019, 21:59 UTC
Message-ID
<20191223215928.GB38316@google.com>
In-Reply-To
<20191223182939.GB676947@alpha>
Kevin Daudt wrote:
> On Mon, Dec 23, 2019 at 10:02:31AM -0800, Junio C Hamano wrote:
Show 7 quoted lines
>> Please unlearn dot-dot and three-dots when using "git diff", which
>> is not about ranges but about comparing two endpoints.  If we were
>> reinventing Git today from scratch, we would make "git diff A..B" an
>> error.  You can consider it a bug that the command accepts a range
>> notation, but this will not change any time soon without a large
>> fight to find and fix uses of the syntax in scripts by longtime Git
>> users have written over the years.
[...]
> I agree that you should not use `A..B`, but what is wrong with
> `A...B`? The alternative is a lot more verbose.
>
> git diff $(git merge-base A B) B

Commands like "git checkout" have been learning a `...` shorthand which is not much better as far as intuitiveness goes:

	# doesn't work, just here for demonstration
	git diff A...B B

With hindsight, "git diff A..B" would be the perfect spelling for this, but that would break too many people's muscle memories and scripts. Would it make sense to have a commandline option for this?

	# doesn't work, just here for demonstration
	git diff --fork-point A B

A random thought, Jonathan

Previous: Kevin DaudtNext: Junio C Hamano
Message 4 of 5 in “Mismatch meaning between git-diff and git-log for the .. (double dot notation) and ... (triple dot notation)”
  1. Arnaud BertrandDec 23, 2019
  2. Junio C HamanoDec 23, 2019
  3. Kevin DaudtDec 23, 2019
  4. Jonathan NiederDec 23, 2019
  5. Junio C HamanoDec 23, 2019

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.