[tor-commits] [githax/master] Bulletproof my git-resquash.sh script a little

nickm at torproject.org nickm at torproject.org
Fri Jan 16 14:36:46 UTC 2015


commit ade2470d12d3f1bd5aa3f908bd2290f565f28abf
Author: Nick Mathewson <nickm at torproject.org>
Date:   Fri Jan 16 09:36:44 2015 -0500

    Bulletproof my git-resquash.sh script a little
---
 scripts/git-resquash.sh |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/scripts/git-resquash.sh b/scripts/git-resquash.sh
index f40f543..87a53e5 100755
--- a/scripts/git-resquash.sh
+++ b/scripts/git-resquash.sh
@@ -1,6 +1,18 @@
 #!/bin/sh
 
-REV=`git log --reverse --format='%H' master..HEAD | head -1`
+PARENT="$1"
+
+if test "x$PARENT" = "x"; then
+    echo "You must specify the parent branch."
+    exit 1
+fi
+
+REV=`git log --reverse --format='%H' ${PARENT}..HEAD | head -1`
+
+if test "x${REV}" = "x"; then
+    echo "No changes here since ${PARENT}"
+    exit 1
+fi
 
 git rebase -i --autosquash ${REV}^
 



More information about the tor-commits mailing list