Git development
 help / color / mirror / Atom feed
From: Tuomas Ahola <taahol@utu.fi>
To: <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>, Julia Evans <julia@jvns.ca>,
	Kristoffer Haugsbakk <code@khaugsbakk.name>,
	Tuomas Ahola <taahol@utu.fi>
Subject: [PATCH v5 0/2] guides: keep Documentation/Makefile and command-list.txt in sync
Date: Mon, 30 Nov 2026 18:22:55 +0200	[thread overview]
Message-ID: <20261130162257.24770-1-taahol@utu.fi> (raw)
In-Reply-To: <20260909052501.8448-1-taahol@utu.fi>

A new linter test has been added to Documentation/lint-manpages.sh
to ensure that all non-command manual pages (concept guides and
interface manuals) listed in Documentation/Makefile are present in
command-list.txt.

Changes in v5:

* [1/2]: Changed commit log message.
* [2/2]: Refactored not to use extract_variable()

Changes in v4:

* [1/2]: Rebased to 0ffa3e35c7 (The 15th batch, 2026-11-04)
* [2/2]: Changed the signature of extract_variable()
  	 to extract_variable <Makefile> <variable>...

Changes in v3:

* [2/2]:
   - Exempt obsoleted gittutorial-2(7).
   - Even more defensive quotation.

Changes in v2:

* [1/2]: Use command-list.txt as the area identifier.
* [2/2]: Protect variables against whitespace breakage per review comment.

Tuomas Ahola (2):
  command-list.txt: add gitformat-loose(5) and gitpacking(7)
  lint-docs: ensure command-list.txt lists all guides

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

Intervall-diff mot v4:
1:  a21c0e2bf7 ! 1:  6ebae33b99 command-list.txt: add gitformat-loose(5) and gitpacking(7)
    @@ Metadata
      ## Commit message ##
         command-list.txt: add gitformat-loose(5) and gitpacking(7)
     
    -    Three manpages from sections 5 and 7 are not featured in
    +    Four manpages from sections 5 and 7 are not featured in
         command-list.txt as concept guides or interface manuals.
     
    -    As easy fixes, add gitformat-loose(5) to 'developerinterfaces'
    -    and make gitpacking(7) a 'guide'.
    +    Two of those omissions are intentional: gittutorial(7) is a mere stub
    +    since bfae357a46 (doc: remove gittutorial-2, 2026-10-26), and listing
    +    gitweb.conf(5) was explicitly decided against in [1].
     
    -    That leaves only gitweb.conf(5) which could be added to
    -    'userinterfaces'.  However, the manual would then appear
    -    as "web.conf" in `git help -a` which is just confusing.
    -    So, perhaps we are better off by leaving it out.
    +    The other two cases, however, are genuine documentation bugs.  Fix the
    +    gaps by adding gitformat-loose(5) to 'developerinterfaces', and by
    +    marking gitpacking(7) as a 'guide'.
    +
    +    Links:
    +      1. <pull.691.v3.git.1596590347.gitgitgadget@gmail.com>
     
         Signed-off-by: Tuomas Ahola <taahol@utu.fi>
     
    +
    + ## Notes ##
    +    Command:
    +
    +      for i in Documentation/git[^-]*.adoc
    +      do
    +      	grep -q ^$(basename --suffix=.adoc $i)[\ ] command-list.txt || head -n 1 $i
    +      done
    +
    +    Output:
    +
    +      gitformat-loose(5)
    +      gitpacking(7)
    +      gittutorial-2(7)
    +      gitweb.conf(5)
    +
      ## command-list.txt ##
     @@ command-list.txt: gitformat-bundle                        developerinterfaces
      gitformat-chunk                         developerinterfaces
2:  4e41401866 ! 2:  fcc9260153 lint-docs: ensure command-list.txt lists all guides
    @@ Commit message
         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 docs Makefile and check command-list.txt
    -    against them.  Exempt gitweb.conf(5) and gittutorial-2(7) from the
    -    new linter routine as deliberate omissions.
    +    Adapt Documentation/lint-manpages.sh to fill that role, and let it
    +    scrutinize command-list.txt against MAN5_TXT and MAN7_TXT.  Exempt
    +    gitweb.conf(5) and gittutorial-2(7) from the new linter routine as
    +    deliberate omissions.
    +
    +    While at it, mark lint-docs-manpages as a .PHONY target.
     
         Signed-off-by: Tuomas Ahola <taahol@utu.fi>
     
    - ## Documentation/lint-manpages.sh ##
    -@@
    - #!/bin/sh
    + ## Documentation/Makefile ##
    +@@ Documentation/Makefile: $(LINT_DOCS_DOC_STYLE): .build/lint-docs/doc-style/%.ok: %.adoc
    + .PHONY: lint-docs-doc-style
    + lint-docs-doc-style: $(LINT_DOCS_DOC_STYLE)
      
    - extract_variable () {
    --	(
    --		cat ../Makefile
    --		cat <<EOF
    -+	file="$1"
    -+	directory="$(dirname "$file")"
    -+	shift
    -+	for i in "$@"
    -+	do
    -+		(
    -+			cat "$file"
    -+			cat <<EOF
    - print_variable:
    - 	@\$(foreach b,\$($1),echo XXX \$(b:\$X=) YYY;)
    - EOF
    --	) |
    --	make -C .. -f - print_variable 2>/dev/null |
    --	sed -n -e 's/.*XXX \(.*\) YYY.*/\1/p'
    -+		) |
    -+		make -C "$directory" -f - print_variable 2>/dev/null |
    -+		sed -n -e 's/.*XXX \(.*\) YYY.*/\1/p'
    -+	done
    - }
    ++.PHONY: lint-docs-manpages
    + lint-docs-manpages:
    +-	$(QUIET_GEN)./lint-manpages.sh
    ++	$(QUIET_GEN)./lint-manpages.sh $(patsubst %.adoc,%,$(MAN5_TXT) $(MAN7_TXT))
      
    + .PHONY: lint-docs-meson
    + lint-docs-meson:
    +
    + ## Documentation/lint-manpages.sh ##
    +@@ Documentation/lint-manpages.sh: EOF
      check_missing_docs () (
      	ret=0
      
    @@ Documentation/lint-manpages.sh: check_missing_docs () (
      
      		if ! test -f "$v.adoc"
     @@ Documentation/lint-manpages.sh: check_extraneous_docs () {
    - 	)
    - }
    - 
    --BUILT_INS="$(extract_variable BUILT_INS)"
    --ALL_COMMANDS="$(extract_variable ALL_COMMANDS)"
    --EXCLUDED_PROGRAMS="$(extract_variable EXCLUDED_PROGRAMS)"
    -+BUILT_INS="$(extract_variable ../Makefile BUILT_INS)"
    -+ALL_COMMANDS="$(extract_variable ../Makefile ALL_COMMANDS)"
    -+EXCLUDED_PROGRAMS="$(extract_variable ../Makefile EXCLUDED_PROGRAMS)"
    -+MAN_GUIDES="$(extract_variable Makefile MAN5_TXT MAN7_TXT | sed -e 's/\.adoc//')"
    + BUILT_INS="$(extract_variable BUILT_INS)"
    + ALL_COMMANDS="$(extract_variable ALL_COMMANDS)"
    + EXCLUDED_PROGRAMS="$(extract_variable EXCLUDED_PROGRAMS)"
    ++MAN_GUIDES="$@"
      
      findings=$(
      	if ! check_missing_docs

base-commit: 0ffa3e35c7c82ab8d0de226149fb03b3f7674d05
-- 
ta/command-list-guides-sync-lint


  parent reply	other threads:[~2026-11-30 16:23 UTC|newest]

Thread overview: 30+ 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 ` [PATCH 2/2] lint-docs: check the guide list in command-list.txt Tuomas Ahola
2026-09-09 18:15   ` 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
2026-10-29 18:48 ` [PATCH v3 0/2] guides: keep Documentation/Makefile and command-list.txt in sync Tuomas Ahola
2026-10-29 18:48   ` [PATCH v3 1/2] command-list.txt: add gitformat-loose(5) and gitpacking(7) Tuomas Ahola
2026-11-05 19:32     ` Junio C Hamano
2026-11-11 21:57       ` Tuomas Ahola
2026-10-29 18:48   ` [PATCH v3 2/2] lint-docs: check the guide list in command-list.txt Tuomas Ahola
2026-11-02 18:39     ` Julia Evans
2026-11-03 17:09       ` Tuomas Ahola
2026-11-05 19:41     ` Junio C Hamano
2026-11-11 22:00       ` Tuomas Ahola
2026-11-26 20:11 ` [PATCH v4 0/2] guides: keep Documentation/Makefile and command-list.txt in sync Tuomas Ahola
2026-11-26 20:11   ` [PATCH v4 1/2] command-list.txt: add gitformat-loose(5) and gitpacking(7) Tuomas Ahola
2026-11-27 14:17     ` Junio C Hamano
2026-11-27 21:02       ` Kristoffer Haugsbakk
2026-11-27 22:14         ` Junio C Hamano
2026-11-26 20:11   ` [PATCH v4 2/2] lint-docs: ensure command-list.txt lists all guides Tuomas Ahola
2026-11-27 10:33     ` Tuomas Ahola
2026-11-27 15:07     ` Junio C Hamano
2026-11-27 17:42       ` Tuomas Ahola
2026-11-27 19:13         ` Junio C Hamano
2026-11-30 16:22 ` Tuomas Ahola [this message]
2026-11-30 16:22   ` [PATCH v5 1/2] command-list.txt: add gitformat-loose(5) and gitpacking(7) Tuomas Ahola
2026-11-30 16:22   ` [PATCH v5 2/2] lint-docs: ensure command-list.txt lists all guides 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=20261130162257.24770-1-taahol@utu.fi \
    --to=taahol@utu.fi \
    --cc=code@khaugsbakk.name \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=julia@jvns.ca \
    /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