Skip to contentSkip to conversation

Best practice question

DISCUSSION D. Stuart Freeman 4 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

My project has an "about" page that lists the version. I understand why git doesn't do keyword expansion, but I'm wondering if there's a recommended best practice for keeping that up to date.

Signature · 2 lines
D. Stuart Freeman
Georgia Institute of Technology

begin:vcard
fn:D. Stuart Freeman
n:Freeman;Douglas
email;internet:[email protected]
tel;work:(404)385-1473
x-mozilla-html:FALSE
version:2.1
end:vcard

#1 lore raw
Quoted 3 lines · D. Stuart Freeman

My project has an "about" page that lists the version. I understand why git doesn't do keyword expansion, but I'm wondering if there's a recommended best practice for keeping that up to date.

Usually when people ask this question on this list, the recommendation is to have the build system generate a suitable version string. Look at how git's own built-in version string is generated, for example. (The GIT-VERSION-GEN script.)

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#2 lore raw
In reply to D. Stuart Freeman
Quoted 3 lines · D. Stuart Freeman

My project has an "about" page that lists the version. I understand why
git doesn't do keyword expansion, but I'm wondering if there's a recommended best practice for keeping that up to date.

If you compile git yourself and run "git --version", it contains the current version number. You may want to do it the same way.

See also the "git-describe" command.

Have fun,

Avery

#3 lore raw
In reply to D. Stuart Freeman
Quoted 3 lines · D. Stuart Freeman

My project has an "about" page that lists the version. I understand why git doesn't do keyword expansion, but I'm wondering if there's a recommended best practice for keeping that up to date.

You can look at how git does it:
It generates a GIT-VERSION-FILE with:

http://git.kernel.org/?p=git/git.git;a=blob;f=GIT-VERSION-GEN;hb=HEAD

and reads it in the Makefile. Or you could generate a version.h file.

Santi