title: How can I simulate svnversion command in git?
body: <p>From <code>svnversion</code> documentation:</p>
  
  <blockquote>
  <pre><code>[adrdec@opsynxvm0081 common_cpp]$ svnversion --help
  usage: svnversion [OPTIONS] [WC_PATH [TRAIL_URL]]
  </code></pre>
    
    <p>Produce a compact 'version number' for the working copy path<br>
    WC_PATH.    For example:</p>
  
  <pre><code>$ svnversion . /repos/svn/trunk
  4168
  </code></pre>
    
    <p>The version number will be a single number if the working   copy is
    single revision, unmodified, not switched and with   an URL that
    matches the TRAIL_URL argument.  If the working   copy is unusual the
    version number will be more complex:</p>
  
  <pre><code>   4123:4168     mixed revision working copy
     4168M         modified working copy
     4123S         switched working copy
     4123P         partial working copy, from a sparse checkout
     4123:4168MS   mixed revision, modified, switched working copy
  </code></pre>
  </blockquote>