From: Michael Haggerty <mhagger@alum.mit.edu>
To: Junio C Hamano <gitster@pobox.com>
Cc: Martin von Zweigbergk <martinvonz@gmail.com>, git@vger.kernel.org
Subject: Re: Fwd: [RFC/FR] Should "git checkout (-B|-b) branch master...branch" work?
Date: Fri, 21 Dec 2012 20:43:24 +0100 [thread overview]
Message-ID: <50D4BBDC.6030700@alum.mit.edu> (raw)
In-Reply-To: <7vr4mj1g8j.fsf@alter.siamese.dyndns.org>
On 12/21/2012 06:12 PM, Junio C Hamano wrote:
> "diff" is always about two endpoints, not the path that connects
> these two endpoints (aka "range"), and when you want to "diff"
> between two commits, you say "diff A B". "A..B" happens to be
> accepted as such only by accident (e.g. the old command line parser
> did not have a reliable way to tell "^A B" and "A..B" apart), not by
> design.
>
> side note: incidentally, now we have rev_cmdline_info support,
> we could start deprecating "diff A..B" syntax.
I often find myself using "git diff A..B" syntax when using the command
line history because the previous command used "A..B"; e.g.,
git log A..B
git diff A..B
It's quick to recall the previous command, edit "log" -> "diff", and
press enter; having to remove the dots would require a few extra keypresses.
> Actually, in many places where the command line parser knows it
> wants a single point, and never a range, we should be able to apply
> the "A...B as a notation to specify a single point" rule.
>
> Of course you could come up with a symbol other than "..." for that
> purpose, and migrate the current "git checkout A...B" special case
> to use that other symbol, but that would be more work and also you
> would need to retrain existing users.
OTOH making A...B sometimes mean a range and sometimes a merge-base
(depending on context) adds a confusing non-uniformity, and also has the
disadvantage of making merge-base shorthand unavailable in contexts that
allow a range.
OTOOH git already has so many notations that can be used on the command
line; inventing yet another one would make it that much more overwhelming.
Michael
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
next prev parent reply other threads:[~2012-12-21 19:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-21 15:58 [RFC/FR] Should "git checkout (-B|-b) branch master...branch" work? Junio C Hamano
[not found] ` <CANiSa6jP_JN+DpDgYpWA9Aky9REJvFq3aR3Yj0vF3+axWvtmsw@mail.gmail.com>
2012-12-21 16:55 ` Fwd: " Martin von Zweigbergk
2012-12-21 17:12 ` Junio C Hamano
2012-12-21 19:43 ` Michael Haggerty [this message]
2012-12-21 21:31 ` Martin von Zweigbergk
2012-12-21 21:45 ` Junio C Hamano
2012-12-21 21:59 ` Michael Haggerty
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=50D4BBDC.6030700@alum.mit.edu \
--to=mhagger@alum.mit.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=martinvonz@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).