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">&lt;<a href="mailto:elpochodelagente@gmail.com">elpochodelagente@gmail.com</a>&gt;</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">&lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt;</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>
&#39;git@gitorious.org:cogvm/blessed.git Commit:<br>
<div>b0df6dc6902a9eb05de02782a77712d855d0422e Date: Wed Jul 20 16:22:16<br>
</div>2011 +0200 By: Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt;&#39;<br>
<div><div></div><div><br>
<br>
On 21 July 2011 18:13, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt; wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; i was looking how to make same trick for git, to embed the revision<br>
&gt; information into the source and found no easy solution.<br>
&gt;<br>
&gt; Using gitattributes is powerful, but too tedious for me to set it up<br>
&gt; fast and too much info for doing simple things. (You may look<br>
&gt; <a href="http://progit.org/book/ch7-2.html" target="_blank">http://progit.org/book/ch7-2.html</a>)<br>
&gt;<br>
&gt; So, to make it fast, i will use shell script to generate output.<br>
&gt;<br>
&gt; Unfortunately, it makes little sense to use #define GIT 1 (in sqSCCVersion.h)<br>
&gt; because its easier to just include generated file:<br>
&gt;<br>
&gt; #include &quot;vmVersionInfo.h&quot;  // defines REVISION_STRING<br>
&gt;<br>
&gt;<br>
&gt; static char *sourceVersionString()<br>
&gt; {<br>
&gt;        return REVISION_STRING;<br>
&gt; }<br>
&gt;<br>
&gt; Where vmVersionInfo.h contents is generated dynamically by shell script.<br>
&gt;<br>
&gt; To extract an URL a following command does it well:<br>
&gt;<br>
&gt; git config --get remote.origin.url<br>
&gt;<br>
&gt; Which shows:<br>
&gt; git@gitorious.org:cogvm/blessed.git<br>
&gt;<br>
&gt; To extract commit info, i using:<br>
&gt;<br>
&gt; git show HEAD --pretty=&quot;Commit: %H Date: %cd By: %cn &lt;%cE&gt;&quot;<br>
&gt;<br>
&gt; Which shows:<br>
&gt; b0df6dc6902a9eb05de02782a77712d855d0422e Date: Wed Jul 20 16:22:16<br>
&gt; 2011 +0200 By: Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt;<br>
&gt;<br>
&gt; So, i will create a script which will generate a header file with<br>
&gt; these two lines concatenated, and then just include it into modified<br>
&gt; sqSCCVersion.h<br>
&gt;<br>
&gt; The problem is that i cannot put invocation of this script it into<br>
&gt; cmake config files, because then it will work only if you check out<br>
&gt; source from git , but not for tarballs.<br>
&gt; So, to generate the version info file this command will run separately<br>
&gt; on server.<br>
&gt;<br>
&gt; The output of sourceVersionString() function will be something like that:<br>
&gt;<br>
&gt; git@gitorious.org:cogvm/blessed.git Commit:<br>
&gt; b0df6dc6902a9eb05de02782a77712d855d0422e Date: Wed Jul 20 16:22:16<br>
&gt; 2011 +0200 By: Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt;<br>
&gt;<br>
&gt; If you have better suggestions how this string should look like<br>
&gt; (format, fields) i am here to listen. :)<br>
&gt;<br>
&gt; --<br>
&gt; Best regards,<br>
&gt; Igor Stasenko AKA sig.<br>
&gt;<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>