threads / discuss / 14038

Best practice question

Subject: Best practice question

## tl;dr

4 messages between Jun 19, 2008 and Jun 19, 2008.

replies: 3people: 4as markdown or json

D. Stuart Freeman· Jun 19, 2008, 14:32 UTC · lore

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.

-- 
D. Stuart Freeman
Georgia Institute of Technology


begin:vcard
fn:D. Stuart Freeman
n:Freeman;Douglas
email;internet:stuart.freeman@et.gatech.edu
tel;work:(404)385-1473
x-mozilla-html:FALSE
version:2.1
end:vcard
Karl Hasselström· Jun 19, 2008, 14:54 UTC · re: D. Stuart Freeman · lore

Re: Best practice question

On 2008-06-19 10:32:35 -0400, D. Stuart Freeman wrote:
> 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.)

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Santi Béjar· Jun 19, 2008, 15:40 UTC · re: D. Stuart Freeman · lore

Re: Best practice question

On Thu, Jun 19, 2008 at 16:32, D. Stuart Freeman <stuart.freeman@et.gatech.edu> wrote:

> 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
Avery Pennarun· Jun 19, 2008, 16:39 UTC · re: D. Stuart Freeman · lore

Re: Best practice question

On 6/19/08, D. Stuart Freeman <stuart.freeman@et.gatech.edu> wrote:
> 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

← back to recent threads