I'm having trouble understanding the output of git submodule status . I think because I do not use tags often.
I added a submodule to the Git repository (you can easily replicate this locally using the 3 git commands below):
/ $ git init / $ git submodule add https://github.com/twbs/bootstrap.git Cloning into 'bootstrap'... ## Output abridged ## / $ git submodule status 93694898838b479d2806c53c827847f724312bcc bootstrap (v2.3.1-2965-g9369489) / $ cd bootstrap/ bootstrap/ $ git rev-parse HEAD 93694898838b479d2806c53c827847f724312bcc
I checked v3.0.0 :
bootstrap/ $ git checkout v3.0.0 Note: checking out 'v3.0.0'.
The output of git submodule status :
/ $ git submodule status e8a1df5f060bf7e6631554648e0abde150aedbe4 bootstrap (v2.3.1-2765-ge8a1df5)
The designation referenced ( e8a1df5 ) makes sense to me, but the tag is confused. man git-submodule says that each line of output git submodule status :
The SHA-1 of the currently checked commit for each submodule, as well as the submodule path and Git output, describe SHA-1.
So the output of git describe e8a1df5f060bf7e6631554648e0abde150aedbe4 is (v2.3.1-2765-ge8a1df5) ? But I just checked v3.0.0 ?!
Anyway, man git-describe says the following:
The command finds the most recent tag available from the commit. If the tag indicates a commit, only the tag is displayed. Otherwise, it adds the tag name suffix to the number of additional commits on top of the marked object and the abbreviated name of the object of the last commit.
So, applying this knowledge to (v2.3.1-2765-ge8a1df5) from the output of git submodule status obtained above:
- "
v2.3.1 " should be the most recent tag available from e8a1df5 - "2765" should be the number of commits at the top of "
v.2.3.1 " - and "
e8a1df5 " should be the abbreviated name of the last commit object (see man gitrevisions re: prefix g )
But for me it does not make sense. Why is v2.3.1 plus 2765 v3.0.0 displayed instead of v3.0.0 ? In the end, I looked at v3.0.0 and:
bootstrap/ $ git tag --contains `git rev-parse HEAD` v3.0.0
How to find out why git describe decided that v2.3.1 is the most recent tag available? What's going on here?