Re: Generate version file by hooks
From: Björn Hendriks <hidden>
Date: 2016-06-15 22:46:24
Hi John, hi Santi, thanks for your help. On Dienstag 17 März 2009 16:42:01 John Dlugosz wrote:
Isn't that what the existing file HEAD is for? Possibly with a level of indirection. So use git rev-parse HEAD any time you need that SHA1 value. The HEAD is always updated, since that _is_ what defines the "current" commit.
That might be a good alternative to my call of git-log which I was not absolutely sure if it works under all circumstances. In fact my problem is not to find out the SHA1 of the last commit in a script but to have that script called automatically each time git changes the commit. My idea was to use the git hooks for that, but as I explained I couldn't find hooks for all cases in which a commit changes. I need git to do that because my application is a Matlab-project which I normally do not compile -- although there is a Matlab-compiler to get a standalone application, but within the Matlab environment you don't need to compile. It would be the same with my little bash-helper-scripts I manage also with the great assistance of git. But now -- as I think of it -- I might as well put a script call into the Matlab-code to get the last SHA1 and find a different solution for the rare cases in which I really compile the Matlab-code. Thanks Björn