title: How can I use "git describe --match" sensibly in combination with a shallow clone?
body: <p>I am using <code>git describe</code> as the driver for versioning in my application at build time.
  It looks roughly like: <code>git describe  --always --dirty --match version*</code></p>
  
  <p>I tag my versions with a pattern like <code>version.1.2.3</code> and the build figures out the version of the application based off what the last commit that was tagged with something like <code>version.*</code> was.
  If I haven't tagged a given commit, then the version number ends up something like <code>version.1.14.3-24-ged66bf5</code>, which is based of the most recent tag, how many commits since that tag and the git commit id.</p>
  
  <p>This works really well for me personally, but I'm having a problem with doing builds off of a shallow clone on my CI server.</p>
  
  <p>When using the "shallow clone" option on my git build in jenkins (I'm guessing it's just doing "--depth=1"), my <code>git describe</code> command is no longer doing what I want it to do.
  My version number just ends up being the commit id - I guess this is because there are no tagged versions in the shallow clone, so the <code>--always</code> parameter for the describe command just ends up spitting out the commit id.</p>
  
  <p>I can deal with this for the moment by not doing a shallow clone.  </p>
  
  <p>But I really like driving my versioning off of the git describe - how can I keep using it even with shallow clones?
  I think what I need to be able to do is specify at the time of the shallow clone, that I want the depth to be "from the tip of the branch back to the latest version that has a tag matching <code>version.*</code>".</p>
  
  <p>Is that a thing I can do with Git?</p>