git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 8/4] check-docs: get documented command list from Makefile

From
Jeff King <peff@peff.net>
Date
Aug 8, 2012, 20:57 UTC
Message-ID
<20120808205752.GD12838@sigill.intra.peff.net>
In-Reply-To
<20120808205456.GB29528@sigill.intra.peff.net>

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>
---
 Documentation/Makefile |  3 +++
 Makefile               | 26 ++------------------------
 2 files changed, 5 insertions(+), 24 deletions(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 063fa69..cf5916f 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -344,4 +344,7 @@ require-htmlrepo::
 quick-install-html: require-htmlrepo
 	'$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REPO) $(DESTDIR)$(htmldir)
 
+print-man1:
+	@for i in $(MAN1_TXT); do echo $$i; done
+
 .PHONY: FORCE
diff --git a/Makefile b/Makefile
index b9da511..51b3c6f 100644
--- a/Makefile
+++ b/Makefile
@@ -2832,34 +2832,12 @@ check-docs::
 		sed -e '/^#/d' \
 		    -e 's/[ 	].*//' \
 		    -e 's/^/listed /' command-list.txt; \
-		ls -1 Documentation/git*txt | \
+		$(MAKE) -C Documentation print-man1 | \
+		grep '\.txt$$' | \
 		sed -e 's|Documentation/|documented |' \
 		    -e 's/\.txt//'; \
 	) | while read how cmd; \
 	do \
-		case "$$how,$$cmd" in \
-		documented,gitattributes | \
-		documented,gitignore | \
-		documented,gitmodules | \
-		documented,gitcli | \
-		documented,git-tools | \
-		documented,gitcore-tutorial | \
-		documented,gitcvs-migration | \
-		documented,gitdiffcore | \
-		documented,gitglossary | \
-		documented,githooks | \
-		documented,gitrepository-layout | \
-		documented,gitrevisions | \
-		documented,gittutorial | \
-		documented,gittutorial-2 | \
-		documented,git-bisect-lk2009 | \
-		documented,git-remote-helpers | \
-		documented,gitworkflows | \
-		documented,gitcredentials | \
-		documented,gitnamespaces | \
-		documented,gitweb.conf | \
-		sentinel,not,matching,is,ok ) continue ;; \
-		esac; \
 		case " $(ALL_COMMANDS) " in \
 		*" $$cmd "*)	;; \
 		*) echo "removed but $$how: $$cmd" ;; \
-- 
1.7.12.rc2.36.gb1dc81b
Previous: Jeff KingNext: Junio C Hamano
Message 12 of 21 in “Documentation: list git-credential in plumbing commands”
  1. Documentation: list git-credential in plumbing commandsMatthieu Moy, Aug 8, 2012
  2. Junio C HamanoAug 8, 2012
  3. Documentation: list git-credential in plumbing commandsMatthieu Moy, Aug 8, 2012
  4. 0/4 update "make check-docs"Jeff King, Aug 8, 2012
  5. 1/4 check-docs: mention gitweb speciallyJeff King, Aug 8, 2012
  6. 2/4 check-docs: update non-command documentation listJeff King, Aug 8, 2012
  7. Junio C HamanoAug 8, 2012
  8. Jeff KingAug 8, 2012
  9. 5/4 check-docs: factor out command-listJeff King, Aug 8, 2012
  10. 6/4 check-docs: list git-gui as a commandJeff King, Aug 8, 2012
  11. 7/4 check-docs: drop git-help special-caseJeff King, Aug 8, 2012
  12. 8/4 check-docs: get documented command list from MakefileJeff King, Aug 8, 2012
  13. Junio C HamanoAug 8, 2012
  14. Philip OakleyAug 8, 2012
  15. Junio C HamanoAug 8, 2012
  16. Philip OakleyAug 9, 2012
  17. 3/4 command-list: add git-sh-i18nJeff King, Aug 8, 2012
  18. 4/4 command-list: mention git-credential-* helpersJeff King, Aug 8, 2012
  19. Matthieu MoyAug 9, 2012
  20. Junio C HamanoAug 8, 2012
  21. Jeff KingAug 8, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.