From: Jeff King Date: Fri, 20 Dec 2024 15:53:42 GMT Subject: Re: [PATCH v2 3/5] Makefile: drop unneeded indirection for GIT-VERSION-GEN outputs Message-ID: <20241220155342.GB152570@coredump.intra.peff.net> In-Reply-To: <20241220-b4-pks-git-version-via-environment-v2-3-f1457a5e8c38@pks.im> On Fri, Dec 20, 2024 at 01:22:47PM +0100, Patrick Steinhardt wrote: > Some of the callsites of GIT-VERSION-GEN generate the target file with a > "+" suffix first and then move the file into place when the new contents > are different compared to the old contents. This allows us to avoid a > needless rebuild by not updating timestamps of the target file when its > contents will remain unchanged anyway. > > In fact though, this exact logic is already handled in GIT-VERSION-GEN, > so doing this manually is pointless. This is a leftover from an earlier > version of 4838deab65 (Makefile: refactor GIT-VERSION-GEN to be > reusable, 2024-12-06), where the script didn't handle that logic for us. > > Drop the needless indirection. Nice. I think when we can do stuff like this in an actual script instead of in a Makefile, the result is more readable. -Peff