check-docs: get documented command list from Makefile

The current code tries to get a list of documented commands by doing "ls Documentation/git*txt" and culling a bunch of special cases from the result. Looking for "git-*.txt" would be more accurate, but would miss a few commands like "gitweb" and "gitk". Fortunately, Documentation/Makefile already knows what this list is, so we can just ask it. Annoyingly, we still have to post-process its output a little, since make will print extra cruft like "GIT-VERSION-FILE is up to date" to stdout. Now that our list is accurate, we can remove all of the ugly special-cases. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Aug 8, 2012 at 16:57 UTC 5fafce0b782dabc48e47828bde5478a15040298f
2 files changed +5 -24
Documentation/Makefile
+3
@@ -344,4 +344,7 @@ require-htmlrepo::
344 quick-install-html: require-htmlrepo
345 '$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REPO) $(DESTDIR)$(htmldir)
346
347 +print-man1:
348 + @for i in $(MAN1_TXT); do echo $$i; done
349 +
350 .PHONY: FORCE
Makefile
+2 -24
@@ -2832,34 +2832,12 @@ check-docs::
2832 sed -e '/^#/d' \
2833 -e 's/[ ].*//' \
2834 -e 's/^/listed /' command-list.txt; \
2835 - ls -1 Documentation/git*txt | \
2835 + $(MAKE) -C Documentation print-man1 | \
2836 + grep '\.txt$$' | \
2837 sed -e 's|Documentation/|documented |' \
2838 -e 's/\.txt//'; \
2839 ) | while read how cmd; \
2840 do \
2840 - case "$$how,$$cmd" in \
2841 - documented,gitattributes | \
2842 - documented,gitignore | \
2843 - documented,gitmodules | \
2844 - documented,gitcli | \
2845 - documented,git-tools | \
2846 - documented,gitcore-tutorial | \
2847 - documented,gitcvs-migration | \
2848 - documented,gitdiffcore | \
2849 - documented,gitglossary | \
2850 - documented,githooks | \
2851 - documented,gitrepository-layout | \
2852 - documented,gitrevisions | \
2853 - documented,gittutorial | \
2854 - documented,gittutorial-2 | \
2855 - documented,git-bisect-lk2009 | \
2856 - documented,git-remote-helpers | \
2857 - documented,gitworkflows | \
2858 - documented,gitcredentials | \
2859 - documented,gitnamespaces | \
2860 - documented,gitweb.conf | \
2861 - sentinel,not,matching,is,ok ) continue ;; \
2862 - esac; \
2841 case " $(ALL_COMMANDS) " in \
2842 *" $$cmd "*) ;; \
2843 *) echo "removed but $$how: $$cmd" ;; \