[mythtv-users] git & wiki

Jarod Wilson jarod at wilsonet.com
Wed Dec 8 16:13:14 UTC 2010

On Dec 8, 2010, at 10:10 AM, Udo van den Heuvel wrote:

> On 2010-12-08 15:07, Ian Kent wrote:
>> On Wed, 2010-12-08 at 21:57 +0800, Ian Kent wrote:
>>>> E.g.: I still need to find out how to get the git commit number we're at
>>>> to adjust the name of the mythtv rpms.
>>> git show HEAD | head -1 | awk '{print $2}'
> Hey, thanks!

No, ew, there are better ways. See below. :)

>>> but that shows the full commit id. You probably only want to use the
>>> first 8 digits of that.
> No problem.  `cut` can fix that, maybe other tricks can help here, too.

git describe | cut -d- -f 3

>>> Other git tools get things right when the first
>>> 8 digits is provided and there hasn't been any time that I have tried to
>>> use just the first 8 digits that has not returned the commit I was
>>> after.
> OK, that is helpful info!

git describe gives you a minimal hash that is guaranteed to be unique.
If more than 8 characters are needed, it'll give 'em to you.

Jarod Wilson
jarod at wilsonet.com

More information about the mythtv-users mailing list