The main gitshed functionality.

Pulls together code from previous commits.

The main() wrapper, BUILD files etc. will follow shortly.
    if not b:
      return
    [...] 

That form is safer since it means you can't accidentally add code at the end that expects to be in the if but was off an indentation level