When python scripts are called from outside of their normal working directory they will not work as expected.
For example, micropython is used as a submodule in a larger project. The makeversionhdr.py script is called by a build system from outside of the micropython repo. the generated header will give the git hash of the parent repo, and not the micropython submodule...
instead these scripts could detect their own location and use the git info from the repo they are contained in.