Skip to content

Commit 65feab8

Browse files
[3.14] gh-159440: Pass --work-tree to the git commands used for the version tag (GH-159442) (#159444)
gh-159440: Pass --work-tree to the git commands used for the version tag (GH-159442) `--git-dir` alone does not imply a work tree, so in an out-of-tree build git checked the build directory, and every tracked file looked deleted: `sys.version` always carried a spurious "-dirty" suffix. (cherry picked from commit 637fb36) Co-authored-by: sendaoYan <yansendao@hygon.cn>
1 parent dacf472 commit 65feab8

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The version string reported by ``sys.version`` no longer carries a spurious
2+
``-dirty`` suffix when CPython is built out-of-tree from a clean git checkout:
3+
the build stamp now checks the source tree instead of the build directory.

‎configure‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ HAS_GIT=no-repository
128128
fi
129129
if test $HAS_GIT = found
130130
then
131-
GITVERSION="git --git-dir \$(srcdir)/.git rev-parse --short HEAD"
132-
GITTAG="git --git-dir \$(srcdir)/.git describe --all --always --dirty"
133-
GITBRANCH="git --git-dir \$(srcdir)/.git name-rev --name-only HEAD"
131+
GITVERSION="git --git-dir \$(srcdir)/.git --work-tree \$(srcdir) rev-parse --short HEAD"
132+
GITTAG="git --git-dir \$(srcdir)/.git --work-tree \$(srcdir) describe --all --always --dirty"
133+
GITBRANCH="git --git-dir \$(srcdir)/.git --work-tree \$(srcdir) name-rev --name-only HEAD"
134134
else
135135
GITVERSION=""
136136
GITTAG=""

0 commit comments

Comments
 (0)