Git Mailing List Archive on lore.kernel.org
 help / color / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Kevin Daudt <kdaudt@alpinelinux.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	Arnaud Bertrand <xda@abalgo.com>,
	git@vger.kernel.org
Subject: Re: Mismatch meaning between git-diff and git-log for the .. (double dot notation) and ... (triple dot notation)
Date: Mon, 23 Dec 2019 13:59:28 -0800
Message-ID: <20191223215928.GB38316@google.com> (raw)
In-Reply-To: <20191223182939.GB676947@alpha>

Kevin Daudt wrote:
> On Mon, Dec 23, 2019 at 10:02:31AM -0800, Junio C Hamano wrote:

>> Please unlearn dot-dot and three-dots when using "git diff", which
>> is not about ranges but about comparing two endpoints.  If we were
>> reinventing Git today from scratch, we would make "git diff A..B" an
>> error.  You can consider it a bug that the command accepts a range
>> notation, but this will not change any time soon without a large
>> fight to find and fix uses of the syntax in scripts by longtime Git
>> users have written over the years.
[...]
> I agree that you should not use `A..B`, but what is wrong with
> `A...B`? The alternative is a lot more verbose.
>
> git diff $(git merge-base A B) B

Commands like "git checkout" have been learning a `...` shorthand
which is not much better as far as intuitiveness goes:

	# doesn't work, just here for demonstration
	git diff A...B B

With hindsight, "git diff A..B" would be the perfect spelling for
this, but that would break too many people's muscle memories and
scripts.  Would it make sense to have a commandline option for this?

	# doesn't work, just here for demonstration
	git diff --fork-point A B

A random thought,
Jonathan

  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-23 12:51 Arnaud Bertrand
2019-12-23 18:02 ` Junio C Hamano
2019-12-23 18:29   ` Kevin Daudt
2019-12-23 21:59     ` Jonathan Nieder [this message]
2019-12-23 22:10     ` Junio C Hamano

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=20191223215928.GB38316@google.com \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kdaudt@alpinelinux.org \
    --cc=xda@abalgo.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

Git Mailing List Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/git/0 git/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 git git/ https://lore.kernel.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.git


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git