[Mesa-dev] [PATCH] automake: increase the MESA_GIT_SHA1 hash id length from 7 to 10 digits

Emil Velikov emil.l.velikov at gmail.com
Thu Jun 15 08:56:55 UTC 2017


Hi Brian,

On 15 June 2017 at 04:46, Brian Paul <brianp at vmware.com> wrote:
> The SCons build has been using 10 digits of the git hash id for the
> MESA_GIT_SHA1 string in git_sha1.h for about a year now.  I bumped it
> up after running into a case where a 7-digit hash ID was ambiguous.
>
> This patch makes the same change for the autotools build.
>
> The command "git log | grep "^commit" | cut -b 8-14 | sort | uniq -d"
> shows there are currently 17 cases where 7 digits of hash id are
> ambiguous on master (probably quite a few more if we'd consider other
> branches).
>
> Instead of using "git log -n 1 --oneline" use
> "git rev-parse --short=10 HEAD" to get the HEAD hash id.

The current command produces 11 digit SHA and size will grow
automatically as needed.
Perhaps we should throw the logic in a small shell script and invoke
it from the build system(s)?

-Emil


More information about the mesa-dev mailing list