git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Tilde spec - befuzzled
@ 2012-02-28  9:07 Luke Diamand
  2012-02-28  9:50 ` Andreas Ericsson
  0 siblings, 1 reply; 10+ messages in thread
From: Luke Diamand @ 2012-02-28  9:07 UTC (permalink / raw)
  To: Git List

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?

So HEAD~1 won't give me the *parent* commit of HEAD, but the 
*grandparent* commit of HEAD (following only the first parents) ?

How do I get to the *parent* commit of HEAD?
Does that mean that HEAD~ != HEAD^
And why does HEAD~1 always look exactly what I would naively call the 
'parent' of HEAD?

I'm pretty sure I'm missing something very obvious. I think it must 
confuse other people as well though, as it's quite easy to find webpages 
around that claim that tildes give the _parent_ commit.

Thanks
Luke

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-03-02  9:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-28  9:07 Tilde spec - befuzzled Luke Diamand
2012-02-28  9:50 ` Andreas Ericsson
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

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).