summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2016-02-29 12:17:25 -0700
committerSean Whitton <spwhitton@spwhitton.name>2016-02-29 12:17:25 -0700
commit8bde9acba565ceb685164666a2be475e3148434a (patch)
tree85c1b5875e92c71ac3bc07e586dedeaf8aa136f3
parent3bc2fc50a2b4c857170b879902da3f3f6e27585e (diff)
downloaddotfiles-8bde9acba565ceb685164666a2be475e3148434a.tar.gz
clean-patch-queues script
-rwxr-xr-xbin/clean-patch-queues20
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/clean-patch-queues b/bin/clean-patch-queues
new file mode 100755
index 00000000..605468d0
--- /dev/null
+++ b/bin/clean-patch-queues
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+. "$HOME/.shenv"
+. "$HOME/lib/tputfs.sh"
+
+status Are you sure you want to delete ALL git branches matching
+status "patch-queue/* in all git repos matching ~/src/* ?"
+status Press enter to confirm or hit C-c to abort
+read _
+
+for repo in $HOME/src/*; do
+ if [ -d "$repo/.git" ]; then
+ cd "$repo"
+ branches="$(git branch | grep ' patch-queue/*' | cut -c3-)"
+ for branch in $branches; do
+ git branch -D "$branch"
+ echo " in repo $(basename $repo)"
+ done
+ fi
+done