New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git doesn't support "-C" args under 1.8.5 occurs in configure.ac #74596
Comments
git doesn't support "-C" args under 1.8.5 occurs in configure.ac as I noticed from git release notes in 1.8.5:
So we should have some conditional statements in configure.ac around git checkpoint, otherwise we got error message which is : Unknown option: -C |
Encounter the same problem on centos7 and git version is 1.8.3. Instead of checking the version to use -C option, maybe we could just use --git-dir for the same purpose? --- a/configure
+++ b/configure
@@ -2749,9 +2749,9 @@ HAS_GIT=no-repository
fi
if test $HAS_GIT = found
then
- GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
- GITTAG="git -C \$(srcdir) describe --all --always --dirty"
- GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
+ GITVERSION="git --git-dir \$(srcdir)/.git rev-parse --short HEAD"
+ GITTAG="git --git-dir \$(srcdir)/.git describe --all --always --dirty"
+ GITBRANCH="git --git-dir \$(srcdir)/.git name-rev --name-only HEAD"
else
GITVERSION=""
GITTAG=""
diff --git a/configure.ac b/configure.ac
index b13728e..278ed9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,9 +39,9 @@ HAS_GIT=no-repository
fi
if test $HAS_GIT = found
then
- GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
- GITTAG="git -C \$(srcdir) describe --all --always --dirty"
- GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
+ GITVERSION="git --git-dir \$(srcdir)/.git rev-parse --short HEAD"
+ GITTAG="git --git-dir \$(srcdir)/.git describe --all --always --dirty"
+ GITBRANCH="git --git-dir \$(srcdir)/.git name-rev --name-only HEAD"
else
GITVERSION=""
GITTAG="" This could give me the right sys._git info. |
Thanks for the PR. I agree with Xiang Zhang that using --git-dir appears to be a better solution. See other review comments on the PR. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: