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