Re: [PATCH v2 3/5] Makefile: drop unneeded indirection for GIT-VERSION-GEN outputs
- From
Jeff King <peff@peff.net>
- Date
- Dec 20, 2024, 15:53 UTC
- 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:
Show 12 quoted lines
> 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