git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Shawn Bohrer <shawn.bohrer@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Confusion about diffing branches
Date: Mon, 27 Aug 2007 00:07:39 -0700	[thread overview]
Message-ID: <7vlkbxmp50.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 20070827014056.GB7422@mediacenter.austin.rr.com

Shawn Bohrer <shawn.bohrer@gmail.com> writes:

> So if I understand you correctly people in the git world are simply more
> used to typing two dots (instead of three) so that is why the two dot
> notation shows the more common use case (show me the difference between
> the tip of the master branch and the tip of the topic branch).

No, what I said was that two dot form is merely there to avoid
saying 'if you want to diff two trees, do not say "diff a..b"
but say "diff a b", dummy!'.  Instead of giving such an error
message, we just say "oh, you want difference between a and b?
here it is".

As to which is common between "diff a..b" and "diff a...b", that
really depends.  You seem to be hinting that you think a...b is
more useful but that is not always the case.  Comparing two
arbitrary trees _is_ the base form of diff, and that is what
"diff a b" gives you.  It does not require two trees to be
related in ancestry relationships in _any_ way.  For example,
you can say "git diff v2.6.20 v2.6.21" or "git diff v2.6.20.4
v2.6.21.2".

On the other hand, when you are into topic branch development
workflow, "diff a...b" is often useful but that does not mean
people using topic branch development does not need "diff a b"
form.  You can say either "diff a b" if you want straight diff
between two trees, or "diff a...b" if you want "what happened in
b, since it forked from the history leading to a"; if the
two-dot form confuses you, you do not have to use that synonym.

Both semantics of two-dot form and three-dot form are useful,
and choice between the two depends on what you want out of the
command.  You just need to know which one you want.

  parent reply	other threads:[~2007-08-27  7:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-26 23:35 Confusion about diffing branches Shawn Bohrer
2007-08-27  0:18 ` Junio C Hamano
2007-08-27  1:40   ` Shawn Bohrer
2007-08-27  6:25     ` Mike Hommey
2007-08-27  7:07     ` Junio C Hamano [this message]
2007-08-27  7:50       ` Mike Hommey
2007-08-27 13:21         ` Francis Moreau
2007-08-27 13:33           ` Mike Hommey
2007-08-27 17:06             ` Junio C Hamano
2007-08-27 17:24               ` Mike Hommey
2007-08-27 17:05           ` Theodore Tso
2007-08-27 17:20             ` Junio C Hamano
2007-08-27 20:29               ` Theodore Tso
2007-08-27 22:20     ` Jakub Narebski

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=7vlkbxmp50.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=shawn.bohrer@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).