aboutsummaryrefslogtreecommitdiff
path: root/what-branches.py
blob: 4c904089ffe680c174a347c7ed67c1debb0c33b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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