<p>On May 2, 2011 11:08 AM, "Marcin Slusarz" <<a href="mailto:marcin.slusarz@gmail.com">marcin.slusarz@gmail.com</a>> wrote:<br>
><br>
> Less recompiles...<br>
> ---<br>
> bin/extract_git_sha1 | 10 ++++++++--<br>
> src/mesa/main/.gitignore | 1 +<br>
> 2 files changed, 9 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/bin/extract_git_sha1 b/bin/extract_git_sha1<br>
> index e6e6731..5e635d4 100755<br>
> --- a/bin/extract_git_sha1<br>
> +++ b/bin/extract_git_sha1<br>
> @@ -1,10 +1,16 @@<br>
> #!/bin/sh<br>
> -touch src/mesa/main/git_sha1.h<br>
> +if [ ! -f src/mesa/main/git_sha1.h ]; then<br>
> + touch src/mesa/main/git_sha1.h<br>
> +fi<br>
> +<br>
> if which git > /dev/null; then<br>
> # Extract the 7-digit "short" SHA1 for the current HEAD, convert<br>
> # it to a string, and wrap it in a #define. This is used in<br>
> # src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.<br>
> git log -n 1 --oneline |\<br>
> sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \<br>
> - > src/mesa/main/git_sha1.h<br>
> + > src/mesa/main/git_sha1.h.tmp<br>
> + if ! cmp -s src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h; then<br>
> + mv src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h<br>
> + fi<br>
> fi<br>
> diff --git a/src/mesa/main/.gitignore b/src/mesa/main/.gitignore<br>
> index e48030e..2575f44 100644<br>
> --- a/src/mesa/main/.gitignore<br>
> +++ b/src/mesa/main/.gitignore<br>
> @@ -3,3 +3,4 @@ api_exec_es2.c<br>
> get_es1.c<br>
> get_es2.c<br>
> git_sha1.h<br>
> +git_sha1.h.tmp<br>
> --<br>
> 1.7.4.1</p>
<p>Reviewed-by: Dan Nicholson <<a href="mailto:dbn.lists@gmail.com">dbn.lists@gmail.com</a>></p>