[PATCH] D56422: gn build: Use "git rev-parse --git-dir" to discover the path to the .git directory.
serge via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 9 07:13:44 PST 2019
serge-sans-paille accepted this revision.
serge-sans-paille added inline comments.
================
Comment at: llvm/utils/gn/build/write_vcsrevision.py:52
+ if not os.path.isdir(git_dir):
+ print('.git dir not found at "%s"' % git_dir, file=sys.stderr)
+ return 1
----------------
pcc wrote:
> serge-sans-paille wrote:
> > For the record, on Python3, `subprocess.check_output` generates bytes and not str. It seems to be ok as an argument to `os.path.isdir`, but it requires an extra `decode()` after the `strip()`
> I tried the modified script with Python 3 and it appeared to work as is. However, I did notice a difference in behaviour between Python 2 and 3, which I've sent a fix for in D56459.
great, LGTM then.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56422/new/
https://reviews.llvm.org/D56422
More information about the llvm-commits
mailing list