Search code examples
gitversion-controlgit-commit

In GIT can we combine commit pointers in this way?


In the following diagram (taken from http://schacon.github.io/git/git-rev-parse#_specifying_revisions), can E not also be referenced by this pointer:

A~^2

G   H   I   J
 \ /     \ /
  D   E   F
   \  |  / \
    \ | /   |
     \|/    |
      B     C
       \   /
        \ /
         A
A =      = A^0
B = A^   = A^1     = A~1
C = A^2  = A^2
D = A^^  = A^1^1   = A~2
E = B^2  = A^^2
F = B^3  = A^^3
G = A^^^ = A^1^1^1 = A~3
H = D^2  = B^^2    = A^^^2  = A~2^2
I = F^   = B^3^    = A^^3^
J = F^2  = B^3^2   = A^^3^2

Solution

  • A~, which is A~1, refers to B, and B^2 refers to E, so if I correctly parsed your question — you have asked whether E can also be referred to using the refspec A~^2, — the answer is "yes, it can be".