]> git.ipfire.org Git - thirdparty/git.git/commit
Makefile: extract script to lint missing/extraneous manpages
authorPatrick Steinhardt <ps@pks.im>
Thu, 6 Jun 2024 08:01:00 +0000 (10:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 Jun 2024 15:20:50 +0000 (08:20 -0700)
commit2dd100c5139c164ce4f86734daec522a8236982e
treee49cdf90bc65a5fcfadec779a3b886cbfba08847
parent7b0defb3915eaa0bd118f0996e8c00b4eb2dc1ca
Makefile: extract script to lint missing/extraneous manpages

The "check-docs" target of our top-level Makefile fulfills two different
roles. For one it runs the "lint-docs" target of the "Documentation/"
Makefile. And second it performs some checks of whether there are any
manpages that are missing or extraneous via some inline scripts.

The second set of checks feels quite misplaced in the top-level Makefile
as it would fit in much better with our "lint-docs" target. Back when
the checks were introduced in 8c989ec528 (Makefile: $(MAKE) check-docs,
2006-04-13), that target did not yet exist though.

Furthermore, the script makes use of several Makefile variables which
are defined in the top-level Makefile, which makes it hard to access
their contents from elsewhere. There is a trick though that we already
use in "check-builtins.sh" to gain access: we can create an ad-hoc
Makefile that has an extra target to print those variables.

Pull out the script into a separate "lint-manpages.sh" script by using
that trick. Wire up that script via the "lint-docs" target. For one,
normal shell scripts are way easier to reason about than those which are
embedded in a Makefile. Second, it allows one to easily execute the
script standalone without any of the other checks.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/Makefile
Documentation/lint-manpages.sh [new file with mode: 0755]
Makefile