[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [githax/master] Bulletproof my git-resquash.sh script a little
commit ade2470d12d3f1bd5aa3f908bd2290f565f28abf
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
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}^
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits