3 # Copyright (c) Josef "Jeff" Sipek, 2008
11 die
"Please read the man page first. (you need to specify -f to force the repair)."
19 [ "$1" != "-f" ] && safety_abort
26 oldrev
=`git show-ref -s "refs/heads/$branch"`
27 echo "Current HEAD commit $oldrev"
29 if [ -s "$applied" ]; then
30 # there were some patches applied
31 newrev
=`git rev-parse $(head -1 < "$applied" | cut -d: -f1)^`
33 # no patches were applied, but let's do all the work anyway
37 echo "New HEAD commit $newrev"
39 echo -n "Are you sure you want to proceed? [y/N] "
41 if [ "$n" != "y" ] && [ "$n" != "Y" ]; then
45 # blow away any commits
46 git
reset --hard "$newrev" > /dev
/null
48 # blow away the applied stack
49 printf "" > "$applied"
51 # update the top/bottom/base tags