]> git.droids-corp.org - git-central.git/commitdiff
Start of tattoo.
authorStephen Haberman <stephen@exigencecorp.com>
Mon, 25 Aug 2008 16:28:50 +0000 (11:28 -0500)
committerStephen Haberman <stephen@exigencecorp.com>
Mon, 25 Aug 2008 16:29:04 +0000 (11:29 -0500)
scripts/gc-tattoo [new file with mode: 0644]

diff --git a/scripts/gc-tattoo b/scripts/gc-tattoo
new file mode 100644 (file)
index 0000000..75f0ea2
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+head=$(git rev-parse HEAD)
+branch=$(git symbolic-ref --quiet HEAD)
+if [ $? -ne 0 ] ; then
+       echo "unknown"
+       exit 1
+fi
+
+case "$branch" in
+       refs/heads/*)
+               branch=${branch##refs/heads/}
+               number=$(git rev-list --first-parent "$head" ^stable | wc -l)
+               echo "$branch-$number"
+               ;;
+       *)
+               echo "unknown"
+               exit 1
+esac
+