Git development
 help / color / mirror / Atom feed
From: Tuomas Ahola <taahol@utu.fi>
To: <git@vger.kernel.org>
Cc: Tuomas Ahola <taahol@utu.fi>
Subject: [PATCH 2/2] lint-docs: check the guide list in command-list.txt
Date: Wed, 9 Sep 2026 08:25:01 +0300	[thread overview]
Message-ID: <20260909052501.8448-3-taahol@utu.fi> (raw)
In-Reply-To: <20260909052501.8448-1-taahol@utu.fi>

Since 2135e1ad70 (command-list.txt: add missing 'gitcredentials' and
'gitremote-helpers', 2020-08-05) there has been a comment in
Documentation/Makefile reminding developers to add new guides also to
command-list.txt.  However, there is no linter script to enforce that.

Adapt Documentation/lint-manpages.sh to fill that role.  Extract
MAN5_TXT and MAN7_TXT from the Makefile and check command-list.txt
against them.  Exempt gitweb.conf(5) from the new linter routine.

Signed-off-by: Tuomas Ahola <taahol@utu.fi>
---

Notes:
    c655855559 (doc: git: list gitdatamodel(7) as a concept guide, 2026-09-05)
    should be merged in to make the new test pass.

 Documentation/Makefile         | 2 ++
 Documentation/lint-manpages.sh | 9 ++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 2699f0b24a..203f6a0c31 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -67,6 +67,8 @@ MAN7_TXT += gittutorial-2.adoc
 MAN7_TXT += gittutorial.adoc
 MAN7_TXT += gitworkflows.adoc
 
+MAN_GUIDES = $(patsubst %.adoc,%,$(MAN5_TXT) $(MAN7_TXT))
+
 HOWTO_TXT += $(wildcard howto/*.adoc)
 
 DOC_DEP_TXT += $(wildcard *.adoc)
diff --git a/Documentation/lint-manpages.sh b/Documentation/lint-manpages.sh
index a0ea572382..290ebe0947 100755
--- a/Documentation/lint-manpages.sh
+++ b/Documentation/lint-manpages.sh
@@ -1,21 +1,22 @@
 #!/bin/sh
 
 extract_variable () {
+	file=${2:-../Makefile}
 	(
-		cat ../Makefile
+		cat $file
 		cat <<EOF
 print_variable:
 	@\$(foreach b,\$($1),echo XXX \$(b:\$X=) YYY;)
 EOF
 	) |
-	make -C .. -f - print_variable 2>/dev/null |
+	make -C $(dirname $file) -f - print_variable 2>/dev/null |
 	sed -n -e 's/.*XXX \(.*\) YYY.*/\1/p'
 }
 
 check_missing_docs () (
 	ret=0
 
-	for v in $ALL_COMMANDS
+	for v in $ALL_COMMANDS $MAN_GUIDES
 	do
 		case "$v" in
 		git-merge-octopus) continue;;
@@ -29,6 +30,7 @@ check_missing_docs () (
 		git-stage) continue;;
 		git-legacy-*) continue;;
 		git-?*--?* ) continue ;;
+		gitweb.conf) continue ;;
 		esac
 
 		if ! test -f "$v.adoc"
@@ -87,6 +89,7 @@ check_extraneous_docs () {
 BUILT_INS="$(extract_variable BUILT_INS)"
 ALL_COMMANDS="$(extract_variable ALL_COMMANDS)"
 EXCLUDED_PROGRAMS="$(extract_variable EXCLUDED_PROGRAMS)"
+MAN_GUIDES="$(extract_variable MAN_GUIDES ./Makefile)"
 
 findings=$(
 	if ! check_missing_docs
-- 
ta/command-list-guides-sync-lint


  parent reply	other threads:[~2026-09-09  5:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09  5:24 [PATCH 0/2] guides: keep Documentation/Makefile and command-list.txt in sync Tuomas Ahola
2026-09-09  5:25 ` [PATCH 1/2] command-list: add gitformat-loose(5) and gitpacking(7) Tuomas Ahola
2026-09-09 18:15   ` Junio C Hamano
2026-09-09  5:25 ` Tuomas Ahola [this message]
2026-09-09 18:15   ` [PATCH 2/2] lint-docs: check the guide list in command-list.txt Junio C Hamano
2026-09-10 19:43 ` [PATCH v2 0/2] guides: keep Documentation/Makefile and command-list.txt in sync Tuomas Ahola
2026-09-10 19:43   ` [PATCH v2 1/2] command-list.txt: add gitformat-loose(5) and gitpacking(7) Tuomas Ahola
2026-09-10 19:43   ` [PATCH v2 2/2] lint-docs: check the guide list in command-list.txt Tuomas Ahola

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=20260909052501.8448-3-taahol@utu.fi \
    --to=taahol@utu.fi \
    --cc=git@vger.kernel.org \
    /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