[Mesa-dev] [PATCH 2/2] mesa: Include GIT SHA1 in GL version string

Ian Romanick idr at freedesktop.org
Sat Apr 2 19:33:56 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/31/2011 01:56 PM, Corbin Simpson wrote:
> On Thu, Mar 31, 2011 at 1:30 PM, Ian Romanick <idr at freedesktop.org> wrote:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> +# The git command below generates an empty string when we're not
>> +# building in a GIT tree (i.e., building from a release tarball).
>>  default: $(TOP)/configs/current
>> +       @touch src/mesa/main/git_sha1.h
>> +       @if which git > /dev/null; then \
>> +           git log -n 1 --oneline |\
>> +               sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "\1"/' \
>> +               > src/mesa/main/git_sha1.h; \
>> +       fi
>>        @for dir in $(SUBDIRS) ; do \
>>                if [ -d $$dir ] ; then \
>>                        (cd $$dir && $(MAKE)) || exit 1 ; \
>
> Hmm, wouldn't the output of "git describe" be more useful?

Like Eric and Kristian mention, 'git describe' seems like it would be
more useful, but in the current tree it is fail.  As Dan suggested, I
could use git-rev-list, but that would just change to:


	git rev-list HEAD^..HEAD |\
		sed 's/^\(.......\).*/#define MESA_GIT_SHA1 "\1"/' \
		> src/mesa/main/git_sha1.h;

I'm not sure that's better.  It is still necessary to use sed because
the SHA1 has to be wrapped in the #define and the short version of the
SHA1 (first 7 digits) is preferable.

Shaung suggested tagging master when we make a stable branch (and use
git-describe).  That option seems attractive, and is probably a good
idea anyway.  However, this assumes that the readable tag (e.g.,
mesa-7.11-devel) is the only tag.  There's nothing to prevent someone
from putting a ivb-magic or r1000-mostly-works tag on master after that.
 I don't think we want that in the GL_VERSION string... but maybe we do.

Opinions?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk2X3JQACgkQX1gOwKyEAw/yYACfdEqHars8wgUrFtRPMl/vAKYy
t8MAni9T+CWcDA8+EmxfMmDBEbOb/N9X
=MnEI
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list