title: Making sense of git submodule status output
body: <p>I am having trouble understanding the output of <code>git submodule status</code>. I think it's because I don't use tags very often.</p>
  
  <p>I added a submodule to a Git repository (you can replicate this locally really easily using the 3 <code>git</code> commands directly below):</p>
  
  <pre><code>/ $ 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
  </code></pre>
  
  <p>I checked out <code>v3.0.0</code>:</p>
  
  <pre><code>bootstrap/ $ git checkout v3.0.0
  Note: checking out 'v3.0.0'.
  ## Tells me about the detached HEAD ##
  HEAD is now at e8a1df5... remove dumb validation reports
  bootstrap/ $ cd ..
  / $ git commit -a -m 'Added submodule and changed its checked out commit'
  </code></pre>
  
  <p>The output of <code>git submodule status</code>:</p>
  
  <pre><code>/ $ git submodule status
  e8a1df5f060bf7e6631554648e0abde150aedbe4 bootstrap (v2.3.1-2765-ge8a1df5)
  </code></pre>
  
  <p>The commit that's referenced  (<code>e8a1df5</code>) makes sense to me, but the tag is confusing. <code>man git-submodule</code> says thats each line of <code>git submodule status</code> output is:</p>
  
  <blockquote>
    <p>the SHA-1 of the currently checked out commit for each submodule, along with the submodule path and the output of git describe for the SHA-1.</p>
  </blockquote>
  
  <p>So the output of <code>git describe e8a1df5f060bf7e6631554648e0abde150aedbe4</code> is <code>(v2.3.1-2765-ge8a1df5)</code>? But I just checked out <code>v3.0.0</code>?! </p>
  
  <p>Anyway, <code>man git-describe</code> says this:</p>
  
  <blockquote>
    <p>The command finds the most recent tag that is reachable from a commit. If the tag points to the commit, then only the tag is shown. Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object and the abbreviated object name of the most recent commit.</p>
  </blockquote>
  
  <p>So, applying this knowledge to <code>(v2.3.1-2765-ge8a1df5)</code> from the <code>git submodule status</code> output I received above:</p>
  
  <ul>
  <li>"<code>v2.3.1</code>" must be the most recent tag reachable from <code>e8a1df5</code></li>
  <li>"2765" must be the number of commits on top of "<code>v.2.3.1</code>"</li>
  <li>and "<code>e8a1df5</code>" must be the abbreviated object name of the most recent commit (see <code>man gitrevisions</code> re: the <code>g</code> prefix)</li>
  </ul>
  
  <p>But this doesn't make sense to me. Why is <code>v2.3.1</code> plus 2765 commits shown instead of <code>v3.0.0</code>? After all, I did check out <code>v3.0.0</code>, and:</p>
  
  <pre><code>bootstrap/ $ git tag --contains `git rev-parse HEAD`
  v3.0.0
  </code></pre>
  
  <p>How can I find out why <code>git describe</code> decided that <code>v2.3.1</code> is the most recent reachable tag? What's going on here?</p>