aboutsummaryrefslogtreecommitdiff
path: root/what-branches.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2015-10-04 15:33:44 -0400
committerRob Austein <sra@hactrn.net>2015-10-04 15:33:44 -0400
commit96c021c73197e09b39d367030c37ec404df56ed3 (patch)
tree0f2078995c14041e6635bb0ef6b76062429663e4 /what-branches.py
parent5206bcd72f52bece3ff35268a2284ec4e84c6109 (diff)
More toys.
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