From: Jeff King <peff@peff.net>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org
Subject: Re: [RFC/largely untested/PATCH] sha1_name: interpret ~n as HEAD~n
Date: Fri, 29 Apr 2011 18:34:33 -0400 [thread overview]
Message-ID: <20110429223433.GA3434@sigill.intra.peff.net> (raw)
In-Reply-To: <6c53916752bf79178113157291fd675ead0804c9.1304092338.git.git@drmicha.warpmail.net>
On Fri, Apr 29, 2011 at 05:53:15PM +0200, Michael J Gruber wrote:
> HEAD~n is often used for rebase invocations etc. Make it use the same
> default we use in other places, i.e. ~n == HEAD~n.
Hmm. It certainly makes sense in that we often default emptiness to
HEAD, but I don't think we can extend this syntax to other things. For
example, seeing ~n makes me think that ^n or ^{tree} would work. But of
course "^" at the beginning of a ref means something completely
different. So it's not completely consistent.
Consistency-wise, I'm not sure if it makes things better or worse.
Obviously we have "foo.." with an implicit HEAD. You could argue that
".." is a different operator altogether, and that any operator that is a
"ref modifier" like "~" or "^" needs to have a non-implicit ref. But
that gets muddier with "@{4.hours.ago}", which also takes an implicit
value, except that it isn't exactly HEAD. It's the branch pointed to by
HEAD.
So there really isn't a lot of consistency, I guess. It also conflicts
a little with the shell's "~user" syntax, though presumably you don't
have users named "1" and "2".
-Peff
next prev parent reply other threads:[~2011-04-29 22:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-29 15:53 [RFC/largely untested/PATCH] sha1_name: interpret ~n as HEAD~n Michael J Gruber
2011-04-29 16:21 ` Junio C Hamano
2011-05-01 8:30 ` Michael J Gruber
2011-05-01 9:04 ` Matthieu Moy
2011-05-01 18:34 ` Junio C Hamano
2011-05-01 21:21 ` Matthieu Moy
2011-04-29 22:34 ` Jeff King [this message]
2011-04-29 23:23 ` Sverre Rabbelier
2011-05-07 2:24 ` Mikael Magnusson
2011-04-29 23:31 ` Andreas Schwab
2011-04-30 5:33 ` Junio C Hamano
2011-04-30 9:09 ` Andreas Schwab
2011-05-02 8:42 ` Michael J Gruber
[not found] ` <BANLkTinxszGhtYobuvci5Yi8eTHW+pi2wA@mail.gmail.com>
2011-05-02 11:04 ` Michael J Gruber
2011-05-02 16:33 ` Junio C Hamano
2011-05-02 17:49 ` Michael J Gruber
2011-05-02 20:14 ` Matthieu Moy
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=20110429223433.GA3434@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@drmicha.warpmail.net \
--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;
as well as URLs for NNTP newsgroup(s).