diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2016-02-29 12:17:25 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-02-29 12:17:25 -0700 |
commit | 8bde9acba565ceb685164666a2be475e3148434a (patch) | |
tree | 85c1b5875e92c71ac3bc07e586dedeaf8aa136f3 | |
parent | 3bc2fc50a2b4c857170b879902da3f3f6e27585e (diff) | |
download | dotfiles-8bde9acba565ceb685164666a2be475e3148434a.tar.gz |
clean-patch-queues script
-rwxr-xr-x | bin/clean-patch-queues | 20 |
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 |