From: Junio C Hamano <gitster@pobox.com>
To: Eugene Sajine <euguess@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: help understanding git diff output
Date: Thu, 27 Jan 2011 15:05:22 -0800 [thread overview]
Message-ID: <7vk4hqgd71.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <AANLkTi=H1LuGfQC8+u83So+6XyOqJxHJ3zsdgs4JTdkc@mail.gmail.com> (Eugene Sajine's message of "Thu\, 27 Jan 2011 17\:11\:57 -0500")
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.
next prev parent reply other threads:[~2011-01-27 23:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-27 22:11 help understanding git diff output Eugene Sajine
2011-01-27 23:05 ` Junio C Hamano [this message]
2011-01-27 23:23 ` Eugene Sajine
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vk4hqgd71.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=euguess@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox