[CRIU] [PATCH 2/2] version: Print git id if present

Kir Kolyshkin kir at openvz.org
Fri Sep 13 14:41:02 EDT 2013


On 09/13/2013 11:13 AM, Cyrill Gorcunov wrote:
> On Fri, Sep 13, 2013 at 10:50:30AM -0700, Kir Kolyshkin wrote:
>> On 09/13/2013 08:35 AM, Cyrill Gorcunov wrote:
>>> If criu is built from git repo print git commit id, convenient for debug.
>>>
>>> For example
>>>
>>>   | $ ./criu -V
>>>   | Version: 0.7
>>>   | GitID: 7985251
>>
>> You can actually do something like
>>
>> VERSION=$(shell git describe --tags HEAD | sed 's/^v//')
>>
>> and in case it's a release it will be say 0.7, otherwise
>> something like 0.7-18-gd3a7d8f.
> I believe this thing should go to plain version instead, while
> gitid is supposed to be git commit sha always. Not sure Kir.

Right, if you have a version string in Makefile anyway
(and you need it since you don't have anything like make dist)
there's no need to get it from git.

Please forget about my comment )
no need to get it from git.


More information about the CRIU mailing list