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

Re: help understanding git diff output

From
ESEugene Sajine <euguess@gmail.com>
Date
Jan 27, 2011, 23:23 UTC
Message-ID
<AANLkTimtHvn3uO2pf8+VWz_1VYediChRx9fdmVw_vVtU@mail.gmail.com>
In-Reply-To
<7vk4hqgd71.fsf@alter.siamese.dyndns.org>
On Thu, Jan 27, 2011 at 6:05 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 30 quoted lines
> Eugene Sajine <euguess@gmail.com> writes:
>
>> I get empty diff when i execute:
>>
>> $git diff branch1..branch2
>>
>> and i also get empty diff when running
>>
>> $git diff branch2..branch1
>
> The thing is, "diff" is about comparing "two endpoints".
>
> We still do support, as a backward compatibility measure, the A..B
> notation to help people who learned "git diff" from ancient documents, and
> we don't plan to deprecate the notation in any way, but don't be fooled by
> the notation which usually means "the range from A to B".  In the context
> of diff, it does not mean a range, as diff is about two "endpoints".
>
>> What i cannot wrap my mind around is why the command below with
>> symmetric difference range gives me non-empty diff
>>
>> $git diff branch1...branch2
>
> "git diff A...B" is a short-hand for "git diff $(git merge-base A B) B",
> naming the fork point between branches A and B as one end, and B as the
> other end, of the diff.  Again, diff is about two "endpoints", and the
> notation does not mean a symmetric difference range.
>
>
>

Thanks a lot, Junio. I was looking at the wrong place in the documentation. Skipped the part in diff doc explaining that range notations are not exactly ranges for diff.

Thanks, Eugene

Previous: Junio C Hamano
Message 3 of 3 in “help understanding git diff output”
  1. Eugene SajineJan 27, 2011
  2. Junio C HamanoJan 27, 2011
  3. Eugene SajineJan 27, 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.