<div class="gmail_quote">On Thu, Mar 10, 2011 at 6:19 PM, Michael Lynch <span dir="ltr">&lt;<a href="mailto:lynchmv@gmail.com">lynchmv@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Thu, Mar 10, 2011 at 5:49 PM, Jan Johansson &lt;<a href="mailto:j2@mupp.net">j2@mupp.net</a>&gt; wrote:<br>
&gt; I pulled a new git about an hour ago (how does one check revision with git<br>
&gt; btw?)<br>
&gt;<br>
&gt;<br>
<br>
</div>Here is how I get the version I pull from git.  I clobbered together<br>
bits and pieces I found over the internet to come up with this:<br>
<br>
git describe |awk -F&quot;.&quot; &#39;{print $2}&#39; |awk -F&quot;-&quot; &#39;{print &quot;0.&quot;$1&quot;.&quot;$2}&#39;<br>
<br>
It outputs something such as:<br>
<br>
lynchmv@slacke6400:~/src/mythtv$ git describe |awk -F&quot;.&quot; &#39;{print $2}&#39;<br>
|awk -F&quot;-&quot; &#39;{print &quot;0.&quot;$1&quot;.&quot;$2}&#39;<br>
0.25pre.1359</blockquote><div><br></div><div>you use:  git describe --dirty</div><div><br></div><div>That&#39;s all that&#39;s really needed.  The version will be like:  v0.25pre-1397-gb584b68</div><div><br></div><div>the first part (to the -) corresponds to what the last tag was..  The second is the number of commits after that tag, and the third (which IS necessary) -- less the &quot;g&quot; -- is the beginning of the SHA1 of the last commit.  There can also be a -dirty at the end if you have custom stuff in there (not committed).</div>
<div><br></div><div>I don&#39;t know why you&#39;d want to decompose the git describe information in the way the previous poster did.  For support, the developers will be wanting the version number as I outlined, and the branch you are on (from git branch, it&#39;s the one with the * beside).  This data is also compiled into the binaries, and is available from &quot;mythfrontend --version&quot; or &quot;mythbackend --version&quot;. </div>
</div>