From 0da3f0985b25b1735b0f32a02d63c520124bccf9 Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Thu, 28 Aug 2008 11:16:50 -0500 Subject: [PATCH] Move some comments around. --- scripts/gc-tattoo | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/scripts/gc-tattoo b/scripts/gc-tattoo index 8244c04..d7139ba 100644 --- a/scripts/gc-tattoo +++ b/scripts/gc-tattoo @@ -1,14 +1,8 @@ #!/bin/sh -head=$(git rev-parse HEAD) - -# Watch out for the very first commit in the repo because we use head^ later -git rev-parse --verify --quiet "$head^" >/dev/null -if [ $? -ne 0 ] ; then - echo "0" - exit 0 -fi - +# +# Some docs +# # A --- B --- C stable # |\ / # | D ----- E topic1 @@ -31,6 +25,16 @@ fi # F: contains=topic1,topic2 # C: contains=topic1 +head=$(git rev-parse HEAD) + +# Watch out for the very first commit in the repo because we use head^ +# Hopefully we can optimize this away later. +git rev-parse --verify --quiet "$head^" >/dev/null +if [ $? -ne 0 ] ; then + echo "0" + exit 0 +fi + contains=($(git branch -r --contains $head)) if [ ${#contains[@]} -eq 0 ] ; then echo "$head has not been pushed" -- 2.20.1