# Best practice question

4 messages from 2008-06-19 to 2008-06-19. Participants: D. Stuart Freeman, Karl Hasselström, Santi Béjar, Avery Pennarun.
Thread: https://gitlist.dev/t/14038

## D. Stuart Freeman, 2008-06-19 14:32

Subject: Best practice question
Message-ID: <485A6E03.6090509@et.gatech.edu>
URL: https://gitlist.dev/e/485A6E03.6090509%40et.gatech.edu

```
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, 2008-06-19 14:54

Subject: Re: Best practice question
Message-ID: <20080619145413.GA18563@diana.vm.bytemark.co.uk>
URL: https://gitlist.dev/e/20080619145413.GA18563%40diana.vm.bytemark.co.uk
In-Reply-To: <485A6E03.6090509@et.gatech.edu>

```
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, 2008-06-19 15:40

Subject: Re: Best practice question
Message-ID: <8aa486160806190840m697ac1en3214626a56014be1@mail.gmail.com>
URL: https://gitlist.dev/e/8aa486160806190840m697ac1en3214626a56014be1%40mail.gmail.com
In-Reply-To: <485A6E03.6090509@et.gatech.edu>

```
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, 2008-06-19 16:39

Subject: Re: Best practice question
Message-ID: <32541b130806190939t2a26c6f7j987eb1c679d53b3a@mail.gmail.com>
URL: https://gitlist.dev/e/32541b130806190939t2a26c6f7j987eb1c679d53b3a%40mail.gmail.com
In-Reply-To: <485A6E03.6090509@et.gatech.edu>

```
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

```
