Tilde spec - befuzzled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]