> How can I embed git version info AUTOMATICALLY while I compile my program<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
> in lazarus, just like {$I %DATE%} ?<br>
<br>
</div>Use a pre-compile script (Project Options|Compiler<br>
Options|Compilation|Execute Before) in combination with a include file.<br></blockquote><div><br>Thanks.<br><br>I realized that this may not work for me. Because I need
to compile the project under both Linux and Windows, and then I need 2
scripts in the same place :-(<br><br>Anyway, I tested with the simplest pre-build script:<br><br>git describe --always > REVISION.INC<br><br><br>Then in my program I added:<br><br>msgs.Lines.Add('GIT HASH: ' + {$I REVISION.INC}); <br>
<br>Unfortunately, it does not compile, the error I got is:<br><br>unit1.pas(831,50) Error: Identifier not found "c25d546"<br><br>It seems that this directive does not load the include file as simple string??<br>
</div></div>