<div class="gmail_quote">On Thu, Mar 10, 2011 at 6:19 PM, Michael Lynch <span dir="ltr"><<a href="mailto:lynchmv@gmail.com">lynchmv@gmail.com</a>></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 <<a href="mailto:j2@mupp.net">j2@mupp.net</a>> wrote:<br>
> I pulled a new git about an hour ago (how does one check revision with git<br>
> btw?)<br>
><br>
><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"." '{print $2}' |awk -F"-" '{print "0."$1"."$2}'<br>
<br>
It outputs something such as:<br>
<br>
lynchmv@slacke6400:~/src/mythtv$ git describe |awk -F"." '{print $2}'<br>
|awk -F"-" '{print "0."$1"."$2}'<br>
0.25pre.1359</blockquote><div><br></div><div>you use: git describe --dirty</div><div><br></div><div>That's all that'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 "g" -- 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't know why you'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's the one with the * beside). This data is also compiled into the binaries, and is available from "mythfrontend --version" or "mythbackend --version". </div>
</div>