code: def show_branches(branch1, branch2):
      
  
      def find_column(string):
          """Find first non space line in the prefix"""
          result = 0
          for c in string:
              if c == ' ':
                  result += 1
          return result
  
      def parse_show_line(string):
          """Parse a typical line from git show-branch
  
          >>> parse_show_line('+  [master^2] TOOLS-122 Add bashrc')
          '+ ', 'master^2', 'TOOLS-122 Add bashrc'
          """
          regexp = re.compile('(.*)\[(.*)] (.*)')
          match = regexp.match(string)
          if not match:
              return None
          prefix, commit, comment = match.groups()
          return find_column(prefix), commit, comment
  
      log = run('show-branch --sha1-name "%s" "%s"' % (branch1, branch2))
      lines = iter(log.splitlines())
      line = lines.next()
      branches = {}
      while line != '--':
          column, branch, comment = parse_show_line(line)
          branches[column] = [branch]
          line = lines.next()
      line = lines.next()
      for line in lines:
          column, commit, comment = parse_show_line(line)
          branches[column].append((commit, comment))
      return branches
docs: Runs git show-branch between the 2 branches, parse result