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

Re: [PATCH] warn use of "git diff A..B"

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Mar 25, 2011, 08:27 UTC
Message-ID
<4D8C520E.1090409@viscovery.net>
In-Reply-To
<m3tyesv7zh.fsf@localhost.localdomain>
Am 3/24/2011 16:44, schrieb Jakub Narebski:
Show 15 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
>> "git diff" (and "diff-tree") accepts a range notation "A..B" from the
>> command line to specify the two endpoints to be compared; the right way to
>> spell this would be "git diff A B".  This is merely a historical accident
>> that comes from the fact that "git log" family of commands and "git diff"
>> happens to share some code in their command line parsers.
> 
> I think it is quite useful to acept this notation to allow for
> copy'n'paste from e.g. "git fetch" output:
> 
>      5e839c8..cd3065f  master     -> origin
> 
> On can simply paste "git diff 5e839c8..cd3065f".
>                               ^^^^^^^^^^^^^^^^

Good point! Of the inconsistencies that still remain in git, IMO, this is the most bearable one, because it's very easy to explain.

-- Hannes
Previous: Jakub NarebskiNext: Jay Soffian
Message 4 of 10 in “diff: remove dead code that flips arguments order”
  1. diff: remove dead code that flips arguments orderJunio C Hamano, Mar 23, 2011
  2. warn use of "git diff A..B"Junio C Hamano, Mar 23, 2011
  3. Jakub NarebskiMar 24, 2011
  4. Johannes SixtMar 25, 2011
  5. Jay SoffianMar 24, 2011
  6. Jay SoffianMar 24, 2011
  7. Junio C HamanoMar 24, 2011
  8. Ævar Arnfjörð BjarmasonMar 25, 2011
  9. Alex RiesenMar 27, 2011
  10. Junio C HamanoMar 28, 2011

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.