Skip to content

Commit ed512cb

Browse files
authored
bpo-27593: Revise git SCM build info. (#744) (#746)
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)
1 parent 4276068 commit ed512cb

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
@@ -407,8 +407,8 @@
407407
<Message Text="Getting build info from $(_GIT)" Importance="high" />
408408
<MakeDir Directories="$(IntDir)" Condition="!Exists($(IntDir))" />
409409
<Exec Command="$(_GIT) name-rev --name-only HEAD &gt; &quot;$(IntDir)gitbranch.txt&quot;" ContinueOnError="true" />
410-
<Exec Command="$(_GIT) rev-parse HEAD &gt; &quot;$(IntDir)gitversion.txt&quot;" ContinueOnError="true" />
411-
<Exec Command="$(_GIT) name-rev --tags --name-only HEAD &gt; &quot;$(IntDir)gittag.txt&quot;" ContinueOnError="true" />
410+
<Exec Command="$(_GIT) rev-parse --short HEAD &gt; &quot;$(IntDir)gitversion.txt&quot;" ContinueOnError="true" />
411+
<Exec Command="$(_GIT) describe --all --always --dirty &gt; &quot;$(IntDir)gittag.txt&quot;" ContinueOnError="true" />
412412
<PropertyGroup>
413413
<GitBranch Condition="Exists('$(IntDir)gitbranch.txt')">$([System.IO.File]::ReadAllText('$(IntDir)gitbranch.txt').Trim())</GitBranch>
414414
<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
@@ -2884,8 +2884,8 @@ HAS_GIT=no-repository
28842884
fi
28852885
if test $HAS_GIT = found
28862886
then
2887-
GITVERSION="git -C \$(srcdir) rev-parse HEAD"
2888-
GITTAG="git -C \$(srcdir) name-rev --tags --name-only HEAD"
2887+
GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
2888+
GITTAG="git -C \$(srcdir) describe --all --always --dirty"
28892889
GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
28902890
else
28912891
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)