From 7938eb9ab73279e2701f8e69208bd32051487f80 Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Mon, 25 Aug 2008 11:28:50 -0500 Subject: [PATCH] Start of tattoo. --- scripts/gc-tattoo | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 scripts/gc-tattoo diff --git a/scripts/gc-tattoo b/scripts/gc-tattoo new file mode 100644 index 0000000..75f0ea2 --- /dev/null +++ b/scripts/gc-tattoo @@ -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 + -- 2.20.1