[(Apple,Git),06/13] Set Apple Git version during build
diff mbox series

Message ID 20190129193818.8645-7-jeremyhu@apple.com
State New
Headers show
Series
  • Differences between git-2.20.1 and Apple Git-116
Related show

Commit Message

Jeremy Sequoia Jan. 29, 2019, 7:38 p.m. UTC
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
 GIT-VERSION-GEN | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Johannes Schindelin Jan. 30, 2019, 1:43 p.m. UTC | #1
Hi Jeremy,

On Tue, 29 Jan 2019, Jeremy Huddleston Sequoia wrote:

> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
> ---
>  GIT-VERSION-GEN | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
> index d1a2814ec7..6fb90854b9 100755
> --- a/GIT-VERSION-GEN
> +++ b/GIT-VERSION-GEN
> @@ -3,6 +3,10 @@
>  GVF=GIT-VERSION-FILE
>  DEF_VER=v2.20.1
>  
> +if [ -n "$RC_ProjectSourceVersion" ] ; then
> +	DEF_VER="$DEF_VER (Apple Git-$RC_ProjectSourceVersion)"
> +fi

This seems awfully specific to a very specific setup. It won't work when
building from a Git checkout, either, as `DEF_VER` is not even used then.

And the existing facility is the `version` file. Since you want to build
this in some sort of automated fashion anyway, you should probably execute

	sed -n "s/^DEF_VER=\\(.*\\)/\\1 (Apple Git-$RC_ProjectSourceVersion)/p" \
		<GIT-VERSION-GEN >version

in your automation script. As a bonus, this will work with any unpatched
Git source code, too!

Ciao,
Johannes

> +
>  LF='
>  '
>  
> -- 
> 2.20.0 (Apple Git-115)
> 
>
Jeremy Sequoia Jan. 30, 2019, 7:45 p.m. UTC | #2
> On Jan 30, 2019, at 05:43, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> 
> Hi Jeremy,
> 
> On Tue, 29 Jan 2019, Jeremy Huddleston Sequoia wrote:
> 
>> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
>> ---
>> GIT-VERSION-GEN | 4 ++++
>> 1 file changed, 4 insertions(+)
>> 
>> diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
>> index d1a2814ec7..6fb90854b9 100755
>> --- a/GIT-VERSION-GEN
>> +++ b/GIT-VERSION-GEN
>> @@ -3,6 +3,10 @@
>> GVF=GIT-VERSION-FILE
>> DEF_VER=v2.20.1
>> 
>> +if [ -n "$RC_ProjectSourceVersion" ] ; then
>> +	DEF_VER="$DEF_VER (Apple Git-$RC_ProjectSourceVersion)"
>> +fi
> 
> This seems awfully specific to a very specific setup. It won't work when
> building from a Git checkout, either, as `DEF_VER` is not even used then.

Yes.  This one was one of the ones I thought obviously fell into the "this is certainly not upstreamable, but let's discuss a general solution to this problem" category.  Sorry if that wasn't clear.

> And the existing facility is the `version` file. Since you want to build
> this in some sort of automated fashion anyway, you should probably execute
> 
> 	sed -n "s/^DEF_VER=\\(.*\\)/\\1 (Apple Git-$RC_ProjectSourceVersion)/p" \
> 		<GIT-VERSION-GEN >version
> 
> in your automation script. As a bonus, this will work with any unpatched
> Git source code, too!

Oh nice!  Thanks for getting rid of one of our patches.

> 
> Ciao,
> Johannes
> 
>> +
>> LF='
>> '
>> 
>> -- 
>> 2.20.0 (Apple Git-115)
>> 
>>

Patch
diff mbox series

diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index d1a2814ec7..6fb90854b9 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -3,6 +3,10 @@ 
 GVF=GIT-VERSION-FILE
 DEF_VER=v2.20.1
 
+if [ -n "$RC_ProjectSourceVersion" ] ; then
+	DEF_VER="$DEF_VER (Apple Git-$RC_ProjectSourceVersion)"
+fi
+
 LF='
 '