From: Andreas Ericsson <ae@op5.se>
To: Luke Diamand <luke@diamand.org>
Cc: Git List <git@vger.kernel.org>
Subject: Re: Tilde spec - befuzzled
Date: Tue, 28 Feb 2012 10:50:12 +0100 [thread overview]
Message-ID: <4F4CA354.2070503@op5.se> (raw)
In-Reply-To: <4F4C995D.9000504@diamand.org>
On 02/28/2012 10:07 AM, Luke Diamand wrote:
> The documentation for caret and tilde specs is making my head hurt, even though they always _do_ exactly what I want. And I thought I understood them until I read more carefully.
>
> A suffix '{caret}' to a revision parameter means the first parent of
> that commit object. '{caret}<n>' means the <n>th parent (i.e.
> '<rev>{caret}'
>
> So far, so good.
>
> '<rev>{tilde}<n>', e.g. 'master{tilde}3'::
> A suffix '{tilde}<n>' to a revision parameter means the commit
> object that is the <n>th generation grand-parent of the named
> commit object, following only the first parents.
>
> Hang on, *grand*-parents?
>
Replace "grand-parent" with "ancestor" and your head might hurt a
little less. Caret only ever describes parent, while tilde can
describe either parent or n'th generation grand-parent. Since parent
and grand-parent are all ancestors, that would be a better term.
I believe this stems from the fact that most git-gurus use a single
caret to specify 'parent' and only go to the tilde when they want
grandparents. It might be because caret was implemented first, or
because of english keyboard layout. On swedish keyboards, using tilde
is far more convenient than using caret, so that's what I mostly use
when I want the parent of a single-parent commit (it requires only
one hand and no thumb-acrobatics even on my laptop).
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
next prev parent reply other threads:[~2012-02-28 9:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-28 9:07 Tilde spec - befuzzled Luke Diamand
2012-02-28 9:50 ` Andreas Ericsson [this message]
2012-02-28 11:34 ` Thomas Rast
2012-02-28 19:20 ` Junio C Hamano
2012-02-29 1:18 ` Andrew Ardill
2012-02-29 7:34 ` Jeff King
2012-02-29 9:30 ` Andreas Ericsson
2012-02-29 9:32 ` Andreas Ericsson
2012-02-29 19:13 ` Re*: " Junio C Hamano
2012-03-02 9:25 ` Luke Diamand
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=4F4CA354.2070503@op5.se \
--to=ae@op5.se \
--cc=git@vger.kernel.org \
--cc=luke@diamand.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).