setuptools_scm
setuptools_scm copied to clipboard
Clean up _git_toplevel()
trafficstars
Instead of asking git what the relative path of the current directory is from the root of the repository and then reverse-engineering the root, simply call git rev-parse --show-toplevel.
This option was added in git 1.7.0 back in 2010, so I think it's fair to assume it exists.