aboutsummaryrefslogtreecommitdiff
path: root/what-branches.py
diff options
context:
space:
mode:
Diffstat (limited to 'what-branches.py')
-rwxr-xr-xwhat-branches.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/what-branches.py b/what-branches.py
new file mode 100755
index 0000000..4c90408
--- /dev/null
+++ b/what-branches.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+#
+# List branches in local repository tree.
+
+from subprocess import check_output
+from os import walk, listdir
+from sys import argv
+
+for root in argv[1:] or listdir("."):
+ for head, dirs, files in walk(root):
+ for dn in dirs:
+ if dn == ".git" and not head.endswith("/gitolite"):
+ print head
+ for line in check_output(("git", "branch", "-a"), cwd = head).splitlines():
+ print " ", line