$OpenBSD: patch-version_sh,v 1.6 2011/04/12 22:59:07 sthen Exp $ --- version.sh.orig Mon Mar 28 22:46:40 2011 +++ version.sh Mon Mar 28 22:48:02 2011 @@ -1,5 +1,8 @@ #!/bin/sh +revision=$(cd "$1" && cat snapshot_version 2> /dev/null) +test "$revision" && revision=git-$revision + # check for git short hash if ! test "$revision"; then revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)