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

Re: Updated Kernel Hacker's guide to git

From
Linus Torvalds <torvalds@osdl.org>
Date
Dec 22, 2006, 04:13 UTC
Message-ID
<Pine.LNX.4.64.0612212009370.3536@woody.osdl.org>
In-Reply-To
<87slf83erg.wl%cworth@cworth.org>
On Thu, 21 Dec 2006, Carl Worth wrote:
Show 12 quoted lines
>
> On Thu, 21 Dec 2006 10:23:30 -0800 (PST), Linus Torvalds wrote:
> > In short, for git diff (and ONLY) git diff, all of these are the same:
> >
> > 	git diff a..b
> > 	git diff a b
> 
> I admit that I had had never passed a range of commits to git diff,
> nor even given any thought to what it might do, but I definitely find
> the above very surprising---and not necessarily very useful. Why is
> anyone ever typing those two dots here if they have no effect on the
> result?

I do it all the time, I never even use the old-fashioned syntax any more. It's much more concise and easy to read, and it has all the nice shortcuts (like empty meaning "HEAD", so you can do "git diff ..next" to see the diff from HEAD to another branch).

It's also useful exactly because of the semantics of things like "...".

In other words, sure, "git diff a b" works, but it just _looks_ more pleasing to use "a..b" and you mentally always pronounce the ".." as "to".

So "git diff a b" doesn't even look good to me any more, because it's literally missing that mental "to" that the ".." adds for me when I read it.

		Linus
Previous: Carl WorthNext: Carl Worth
Message 4 of 12 in “Re: Updated Kernel Hacker's guide to git”
  1. Francis MoreauDec 21, 2006
  2. Linus TorvaldsDec 21, 2006
  3. Carl WorthDec 22, 2006
  4. Linus TorvaldsDec 22, 2006
  5. Carl WorthDec 22, 2006
  6. Linus TorvaldsDec 22, 2006
  7. Junio C HamanoDec 22, 2006
  8. Carl WorthDec 22, 2006
  9. Jakub NarebskiDec 22, 2006
  10. Francis MoreauDec 22, 2006
  11. Junio C HamanoDec 22, 2006
  12. Francis MoreauDec 22, 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.