[Python-checkins] [2.7] bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. (GH-8744) (GH-8838)

Xiang Zhang webhook-mailer at python.org
Mon Aug 20 11:15:18 EDT 2018


https://github.com/python/cpython/commit/95f9e14e33b713f35f5368acf7be56750bbdb5a8
commit: 95f9e14e33b713f35f5368acf7be56750bbdb5a8
branch: 2.7
author: Xiang Zhang <angwerzx at 126.com>
committer: GitHub <noreply at github.com>
date: 2018-08-20T23:15:07+08:00
summary:

[2.7] bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. (GH-8744) (GH-8838)

(cherry picked from commit 4c8555773a801f957297132a92c0acb382d640e4)

files:
M configure
M configure.ac

diff --git a/configure b/configure
index a75ca3a0f5c9..03b73c6f1356 100755
--- a/configure
+++ b/configure
@@ -5791,9 +5791,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 36625f7b82a3..257c8eb21e54 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1005,9 +1005,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=""



More information about the Python-checkins mailing list