Subject: Re: [PATCH v3 4/6] GIT-VERSION-GEN: fix overriding GIT_VERSION

From: Junio C Hamano <[email-masked]>
Date: Fri, 20 Dec 2024 13:50:25 -0800

Patrick Steinhardt <[email-masked]> writes:

> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index ff30ab6c4295525757f6a150ec4ff0c72487f440..a89823e1d1ee5042367bdcca6ed426196d49ce89 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -181,6 +181,10 @@ endif
>  -include ../config.mak.autogen
>  -include ../config.mak
>  
> +# Set GIT_VERSION_OVERRIDE such that version_gen knows to substitute
> +# GIT_VERSION in case it was set by the user.
> +GIT_VERSION_OVERRIDE := $(GIT_VERSION)
> +
>  ifndef NO_MAN_BOLD_LITERAL
>  XMLTO_EXTRA += -m manpage-bold-literal.xsl
>  endif

So the idea is that those targets and scripts may have their own
GIT_VERION value when they run GIT-VERSION-GEN to cause GIT_VERSION
to computed, and in such a case, they should pass the GIT_VERSION
they have in GIT_VERSION_OVERRIDE, and thanks to the version_gen
thing, this value in GIT_VERSION_OVERRIDE is passed in the
environment as GIT_VERSION when GIT-VERSION-GEN is run, and the
value in turn is passed intact.  Somehow this makes my head spin, as
it looks quite convoluted, but the overall flow should yield the
desired value.

Queued.  Thanks.