From 21fef0ded85b4cff0adb88b945ebff79d432e0f2 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 5 Jun 2010 07:20:49 -0700 Subject: [PATCH] script to replace, eventually if I'm lucky, svnversion as a way to mark a build's source. --- xwords4/scripts/gitversion.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 xwords4/scripts/gitversion.sh diff --git a/xwords4/scripts/gitversion.sh b/xwords4/scripts/gitversion.sh new file mode 100755 index 000000000..0e7f76e9f --- /dev/null +++ b/xwords4/scripts/gitversion.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +usage() { + echo "usage: $0" + exit 1 +} + +[ -z "$1" ] || usage + +HASH=$(git log -1 --pretty=format:%H) + +# mark it with a "+" if anything's changed +if git status --porcelain | grep -q '^[^\?]'; then + HASH="${HASH}+M" +fi + +echo $HASH