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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 24, 2011, 18:33 UTC
Message-ID
<7vtyes8j1z.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTikjN_90UApfD2rRksDk8qXyE6pJHhd00Aw-Qe7Y@mail.gmail.com>
Jay Soffian <jaysoffian@gmail.com> writes:
Show 9 quoted lines
> On Wed, Mar 23, 2011 at 5:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
> ... this is not consistent ...
>
>> The new code does not issue a warning against "git diff ..B" that is used
>> as a shorthand for "git diff HEAD B", and "git diff A.." that is used as a
>> shorthand for "git diff A HEAD", respectively.  These are shorter to type
>> and are often useful.
>
> ...with this.

I already _know_ it is not consistent. My verdict is that shoter-to-type and being useful trumps that minor consistency argument and that is why the patch is like so, and that is why the proposed commit log message clearly describes the choice.

> I use diff A..B all the time, because I've often just used log A..B,
> or I'm about to, and it's one less part of the command line to change.

OK. I hereby designate you as the official cluebat wearer responsible for explaining things whenever new people get confused and say that the output from "git diff A..B" does not match what they expect from "git log A..B", (and "git diff A...B" vs "git log A...B") on this list.

Thanks ;-).
Previous: Jay SoffianNext: Ævar Arnfjörð Bjarmason
Message 7 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.