Kaydet (Commit) e9213d92 authored tarafından Ned Deily's avatar Ned Deily Kaydeden (comit) GitHub

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:05f53735, ...
3. Python 3.7.0a0 (v3.7.0a0:05f53735, ...

Development build:
1. Python 3.7.0a0 (default:41df79263a11, ...
2. Python 3.7.0a0 (master:05f53735, ...
3. Python 3.7.0a0 (heads/master-dirty:05f53735, ...

"dirty" means the working tree has uncommitted changes.
See "git help describe" for more info.
(cherry picked from commit 554626ad)
üst fcd79ada
...@@ -414,8 +414,8 @@ ...@@ -414,8 +414,8 @@
<Message Text="Getting build info from $(_GIT)" Importance="high" /> <Message Text="Getting build info from $(_GIT)" Importance="high" />
<MakeDir Directories="$(IntDir)" Condition="!Exists($(IntDir))" /> <MakeDir Directories="$(IntDir)" Condition="!Exists($(IntDir))" />
<Exec Command="$(_GIT) name-rev --name-only HEAD &gt; &quot;$(IntDir)gitbranch.txt&quot;" ContinueOnError="true" /> <Exec Command="$(_GIT) name-rev --name-only HEAD &gt; &quot;$(IntDir)gitbranch.txt&quot;" ContinueOnError="true" />
<Exec Command="$(_GIT) rev-parse HEAD &gt; &quot;$(IntDir)gitversion.txt&quot;" ContinueOnError="true" /> <Exec Command="$(_GIT) rev-parse --short HEAD &gt; &quot;$(IntDir)gitversion.txt&quot;" ContinueOnError="true" />
<Exec Command="$(_GIT) name-rev --tags --name-only HEAD &gt; &quot;$(IntDir)gittag.txt&quot;" ContinueOnError="true" /> <Exec Command="$(_GIT) describe --all --always --dirty &gt; &quot;$(IntDir)gittag.txt&quot;" ContinueOnError="true" />
<PropertyGroup> <PropertyGroup>
<GitBranch Condition="Exists('$(IntDir)gitbranch.txt')">$([System.IO.File]::ReadAllText('$(IntDir)gitbranch.txt').Trim())</GitBranch> <GitBranch Condition="Exists('$(IntDir)gitbranch.txt')">$([System.IO.File]::ReadAllText('$(IntDir)gitbranch.txt').Trim())</GitBranch>
<GitVersion Condition="Exists('$(IntDir)gitversion.txt')">$([System.IO.File]::ReadAllText('$(IntDir)gitversion.txt').Trim())</GitVersion> <GitVersion Condition="Exists('$(IntDir)gitversion.txt')">$([System.IO.File]::ReadAllText('$(IntDir)gitversion.txt').Trim())</GitVersion>
......
...@@ -2743,8 +2743,8 @@ HAS_GIT=no-repository ...@@ -2743,8 +2743,8 @@ HAS_GIT=no-repository
fi fi
if test $HAS_GIT = found if test $HAS_GIT = found
then then
GITVERSION="git -C \$(srcdir) rev-parse HEAD" GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
GITTAG="git -C \$(srcdir) name-rev --tags --name-only HEAD" GITTAG="git -C \$(srcdir) describe --all --always --dirty"
GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD" GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
else else
GITVERSION="" GITVERSION=""
......
...@@ -37,8 +37,8 @@ HAS_GIT=no-repository ...@@ -37,8 +37,8 @@ HAS_GIT=no-repository
fi fi
if test $HAS_GIT = found if test $HAS_GIT = found
then then
GITVERSION="git -C \$(srcdir) rev-parse HEAD" GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
GITTAG="git -C \$(srcdir) name-rev --tags --name-only HEAD" GITTAG="git -C \$(srcdir) describe --all --always --dirty"
GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD" GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
else else
GITVERSION="" GITVERSION=""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment