On Fri, Dec 20, 2024 at 06:17:16AM -0500, Jeff King wrote: > On Fri, Dec 20, 2024 at 10:31:30AM +0100, Patrick Steinhardt wrote: > > > > > I guess. It'll become quite painful to do this at every callsite, so > > > > I'll add another commit on top to introduce a call template that does > > > > all of this for us. > > > > > > Is there any reason not to just do: > > > > > > export GIT_VERSION > > > export GIT_DATE > > > export GIT_BUILT_FROM_COMMIT > > > export GIT_USER_AGENT > > > > > > in shared.mak? Then you only have to do it once, and no need for > > > templates. > > > > You could do that, yeah, but the user needs to be aware that they can. > > I'm happy to not go down that path and live with the above solution. > > Alternatively, this would be what the call template would look like. > > I meant that _we_ would mark those variables for export ourselves (in > shared.mak, which is used by all of our Makefiles, not the user's > config.mak). > > I.e., this: > > diff --git a/shared.mak b/shared.mak > index 29bebd30d8..4aa7dbf5e0 100644 > --- a/shared.mak > +++ b/shared.mak > @@ -116,3 +116,5 @@ endef > define libpath_template > -L$(1) $(if $(filter-out -L,$(CC_LD_DYNPATH)),$(CC_LD_DYNPATH)$(1)) > endef > + > +export GIT_VERSION > > which makes: > > echo 'GIT_VERSION = foo' >config.mak > make > > behave as it used to (when coupled with the fix you already sent to > respect the variable within the version-gen script). Ah, I misread "shared.mak" and thought you meant "config.mak". That makes more sense then, thanks! Patrick