Skip to content

Commit 8c18fbe

Browse files
committed
bpo-27593: Revise git SCM build info. (#744) (#745)
Use --short form of git hash. Use output from "git describe" for tag. Expected outputs: 1. previous hg 2. previous git 3. updated git Release (tagged) build: 1. Python 3.7.0a0 (v3.7.0a0:4def2a2901a5, ... 2. Python 3.7.0a0 (v3.7.0a0^0:05f53735c8912f8df1077e897f052571e13c3496, ... 3. Python 3.7.0a0 (v3.7.0a0:05f53735c8, ... Development build: 1. Python 3.7.0a0 (default:41df79263a11, ... 2. Python 3.7.0a0 (master:05f53735c8912f8df1077e897f052571e13c3496, ... 3. Python 3.7.0a0 (heads/master-dirty:05f53735c8, ... "dirty" means the working tree has uncommitted changes. See "git help describe" for more info. (cherry picked from commit 554626a) (cherry picked from commit e9213d9)
1 parent 360c49b commit 8c18fbe

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

PCbuild/pythoncore.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@
414414
<Message Text="Getting build info from $(_GIT)" Importance="high" />
415415
<MakeDir Directories="$(IntDir)" Condition="!Exists($(IntDir))" />
416416
<Exec Command="$(_GIT) name-rev --name-only HEAD &gt; &quot;$(IntDir)gitbranch.txt&quot;" ContinueOnError="true" />
417-
<Exec Command="$(_GIT) rev-parse HEAD &gt; &quot;$(IntDir)gitversion.txt&quot;" ContinueOnError="true" />
418-
<Exec Command="$(_GIT) name-rev --tags --name-only HEAD &gt; &quot;$(IntDir)gittag.txt&quot;" ContinueOnError="true" />
417+
<Exec Command="$(_GIT) rev-parse --short HEAD &gt; &quot;$(IntDir)gitversion.txt&quot;" ContinueOnError="true" />
418+
<Exec Command="$(_GIT) describe --all --always --dirty &gt; &quot;$(IntDir)gittag.txt&quot;" ContinueOnError="true" />
419419
<PropertyGroup>
420420
<GitBranch Condition="Exists('$(IntDir)gitbranch.txt')">$([System.IO.File]::ReadAllText('$(IntDir)gitbranch.txt').Trim())</GitBranch>
421421
<GitVersion Condition="Exists('$(IntDir)gitversion.txt')">$([System.IO.File]::ReadAllText('$(IntDir)gitversion.txt').Trim())</GitVersion>

configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2743,8 +2743,8 @@ HAS_GIT=no-repository
27432743
fi
27442744
if test $HAS_GIT = found
27452745
then
2746-
GITVERSION="git -C \$(srcdir) rev-parse HEAD"
2747-
GITTAG="git -C \$(srcdir) name-rev --tags --name-only HEAD"
2746+
GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
2747+
GITTAG="git -C \$(srcdir) describe --all --always --dirty"
27482748
GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
27492749
else
27502750
GITVERSION=""

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ HAS_GIT=no-repository
3737
fi
3838
if test $HAS_GIT = found
3939
then
40-
GITVERSION="git -C \$(srcdir) rev-parse HEAD"
41-
GITTAG="git -C \$(srcdir) name-rev --tags --name-only HEAD"
40+
GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
41+
GITTAG="git -C \$(srcdir) describe --all --always --dirty"
4242
GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
4343
else
4444
GITVERSION=""

0 commit comments

Comments
 (0)