1#!/bin/sh 2#This script prints the short-format git SHA-1 string if the source directory 3# has a ".git" directory. 4# 5# This will typically only be called from a Makefile, with $(top_srcdir) as the 6# first argument. Its purpose is so we can inject the git commit ID 7# into the "Help->About" dialog box. 8 9SRCDIR=$1 10SHASTRING="" 11cd $SRCDIR 12if [ -e .git ] 13then 14 GITSHA=`git log --pretty=format:%h -1` 15 SHASTRING=" (${GITSHA})" 16fi 17echo $SHASTRING 18