def root():
    """ returns the absolute path of the repository root """
try:
    base = check_output('git rev-parse --show-toplevel', shell=True)
except CalledProcessError:
    pass
Find the root of the git repository where the file lives