[Vm-dev] Re: About sqSCCVersion.h

Igor Stasenko siguctua at gmail.com
Tue Sep 13 12:21:34 UTC 2011


On 13 September 2011 12:20, Guido Chari <charig at gmail.com> wrote:
>
> Thanks for this info...
> In Unix its needs execution permissions first...

you can just run it via sh.


> Guido
>
> 2011/9/9 Javier Pimás <elpochodelagente at gmail.com>
>>
>>
>> just to document... the script to execute is in /path/to/vmsource/codegen-scripts/extract-commit-info.sh, and as its comment says, should be run from build dir, like this:
>> build$ ../codegen-scripts/extract-commit-info.sh
>> after that, everything should work.
>> cheers,
>> Javier.
>>
>> On Thu, Jul 21, 2011 at 2:03 PM, Igor Stasenko <siguctua at gmail.com> wrote:
>>>
>>> After merging codebase from svn it seems to working well:
>>>
>>> Smalltalk getSystemAttribute: 1009
>>> 'git at gitorious.org:cogvm/blessed.git Commit:
>>> b0df6dc6902a9eb05de02782a77712d855d0422e Date: Wed Jul 20 16:22:16
>>> 2011 +0200 By: Igor Stasenko <siguctua at gmail.com>'
>>>
>>>
>>> On 21 July 2011 18:13, Igor Stasenko <siguctua at gmail.com> wrote:
>>> > Hello,
>>> >
>>> > i was looking how to make same trick for git, to embed the revision
>>> > information into the source and found no easy solution.
>>> >
>>> > Using gitattributes is powerful, but too tedious for me to set it up
>>> > fast and too much info for doing simple things. (You may look
>>> > http://progit.org/book/ch7-2.html)
>>> >
>>> > So, to make it fast, i will use shell script to generate output.
>>> >
>>> > Unfortunately, it makes little sense to use #define GIT 1 (in sqSCCVersion.h)
>>> > because its easier to just include generated file:
>>> >
>>> > #include "vmVersionInfo.h"  // defines REVISION_STRING
>>> >
>>> >
>>> > static char *sourceVersionString()
>>> > {
>>> >        return REVISION_STRING;
>>> > }
>>> >
>>> > Where vmVersionInfo.h contents is generated dynamically by shell script.
>>> >
>>> > To extract an URL a following command does it well:
>>> >
>>> > git config --get remote.origin.url
>>> >
>>> > Which shows:
>>> > git at gitorious.org:cogvm/blessed.git
>>> >
>>> > To extract commit info, i using:
>>> >
>>> > git show HEAD --pretty="Commit: %H Date: %cd By: %cn <%cE>"
>>> >
>>> > Which shows:
>>> > b0df6dc6902a9eb05de02782a77712d855d0422e Date: Wed Jul 20 16:22:16
>>> > 2011 +0200 By: Igor Stasenko <siguctua at gmail.com>
>>> >
>>> > So, i will create a script which will generate a header file with
>>> > these two lines concatenated, and then just include it into modified
>>> > sqSCCVersion.h
>>> >
>>> > The problem is that i cannot put invocation of this script it into
>>> > cmake config files, because then it will work only if you check out
>>> > source from git , but not for tarballs.
>>> > So, to generate the version info file this command will run separately
>>> > on server.
>>> >
>>> > The output of sourceVersionString() function will be something like that:
>>> >
>>> > git at gitorious.org:cogvm/blessed.git Commit:
>>> > b0df6dc6902a9eb05de02782a77712d855d0422e Date: Wed Jul 20 16:22:16
>>> > 2011 +0200 By: Igor Stasenko <siguctua at gmail.com>
>>> >
>>> > If you have better suggestions how this string should look like
>>> > (format, fields) i am here to listen. :)
>>> >
>>> > --
>>> > Best regards,
>>> > Igor Stasenko AKA sig.
>>> >
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko AKA sig.
>>
>>
>>
>> --
>> Lic. Javier Pimás
>> Ciudad de Buenos Aires
>>
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list