git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Matthieu Moy <Matthieu.Moy@imag.fr>, git@vger.kernel.org
Subject: [PATCH 8/4] check-docs: get documented command list from Makefile
Date: Wed, 8 Aug 2012 16:57:52 -0400	[thread overview]
Message-ID: <20120808205752.GD12838@sigill.intra.peff.net> (raw)
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

  parent reply	other threads:[~2012-08-08 20:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08  7:58 [PATCH] Documentation: list git-credential in plumbing commands Matthieu Moy
2012-08-08 16:58 ` Junio C Hamano
2012-08-08 17:13   ` [PATCH v2] " Matthieu Moy
2012-08-08 18:31   ` [PATCH 0/4] update "make check-docs" Jeff King
2012-08-08 18:32     ` [PATCH 1/4] check-docs: mention gitweb specially Jeff King
2012-08-08 18:34     ` [PATCH 2/4] check-docs: update non-command documentation list Jeff King
2012-08-08 19:24       ` Junio C Hamano
2012-08-08 20:54         ` Jeff King
2012-08-08 20:56           ` [PATCH 5/4] check-docs: factor out command-list Jeff King
2012-08-08 20:56           ` [PATCH 6/4] check-docs: list git-gui as a command Jeff King
2012-08-08 20:57           ` [PATCH 7/4] check-docs: drop git-help special-case Jeff King
2012-08-08 20:57           ` Jeff King [this message]
2012-08-08 21:35             ` [PATCH 8/4] check-docs: get documented command list from Makefile Junio C Hamano
2012-08-08 22:11           ` [PATCH 2/4] check-docs: update non-command documentation list Philip Oakley
2012-08-08 22:51             ` Junio C Hamano
2012-08-09  6:34               ` Philip Oakley
2012-08-08 18:34     ` [PATCH 3/4] command-list: add git-sh-i18n Jeff King
2012-08-08 18:34     ` [PATCH 4/4] command-list: mention git-credential-* helpers Jeff King
2012-08-09  8:02       ` Matthieu Moy
2012-08-08 19:13     ` [PATCH 0/4] update "make check-docs" Junio C Hamano
2012-08-08 20:10       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120808205752.GD12838@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Matthieu.Moy@imag.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).