Re: [PATCH v3 4/6] GIT-VERSION-GEN: fix overriding GIT_VERSION
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Dec 21, 2024, 10:30 UTC
- Message-ID
- <Z2aYx608clVG_sAF@pks.im>
- In-Reply-To
- <xmqq4j2ydnxa.fsf@gitster.g>
On Fri, Dec 20, 2024 at 01:50:25PM -0800, Junio C Hamano wrote:
Show 27 quoted lines
> Patrick Steinhardt <ps@pks.im> 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.
Agreed, it makes mine spin, as well. Next release cycle I'll have a look at whether I can get rid of the include of "GIT-VERSION-FILE" altogether to make the logic simpler.
Patrick