Skip to content

Commit 5fafce0

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7d02b57 commit 5fafce0

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

Documentation/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,4 +344,7 @@ require-htmlrepo::
344344
quick-install-html: require-htmlrepo
345345
'$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REPO) $(DESTDIR)$(htmldir)
346346

347+
print-man1:
348+
@for i in $(MAN1_TXT); do echo $$i; done
349+
347350
.PHONY: FORCE

Makefile

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2832,34 +2832,12 @@ check-docs::
28322832
sed -e '/^#/d' \
28332833
-e 's/[ ].*//' \
28342834
-e 's/^/listed /' command-list.txt; \
2835-
ls -1 Documentation/git*txt | \
2835+
$(MAKE) -C Documentation print-man1 | \
2836+
grep '\.txt$$' | \
28362837
sed -e 's|Documentation/|documented |' \
28372838
-e 's/\.txt//'; \
28382839
) | while read how cmd; \
28392840
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; \
28632841
case " $(ALL_COMMANDS) " in \
28642842
*" $$cmd "*) ;; \
28652843
*) echo "removed but $$how: $$cmd" ;; \

0 commit comments

Comments
 (0)