guides: keep Documentation/Makefile and command-list.txt in sync
cover guides: keep Documentation/Makefile and command-list.txt in sync
Documentation/lint-manpages.sh was expanded with a new test ensuring that command-list.txt also includes all non-command manual pages (concept guides and interface manuals).
Based on kh/doc-datamodel.
Tuomas Ahola (2):
command-list: add gitformat-loose(5) and gitpacking(7)
lint-docs: check the guide list in command-list.txt
Documentation/Makefile | 2 ++ Documentation/lint-manpages.sh | 9 ++++++--- command-list.txt | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-)
base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc
prerequisite-patch-id: 13af80fdddfc7d4f65437343cee0ca3787cbdea4
Signature · 1 line
ta/command-list-guides-sync-lint
PATCH 1/2 command-list: add gitformat-loose(5) and gitpacking(7)
Three 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'.
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.
--- command-list.txt | 2 ++ 1 file changed, 2 insertions(+)
command-list.txt +2 -0
@@ -225,6 +225,7 @@ gitformat-bundle developerinterfaces gitformat-chunk developerinterfaces gitformat-commit-graph developerinterfaces gitformat-index developerinterfaces +gitformat-loose developerinterfaces gitformat-pack developerinterfaces gitformat-signature developerinterfaces gitglossary guide
@@ -234,6 +235,7 @@ gitk mainporcelain gitmailmap userinterfaces gitmodules userinterfaces gitnamespaces guide +gitpacking guide gitprotocol-capabilities developerinterfaces gitprotocol-common developerinterfaces gitprotocol-http developerinterfaces
Signature · 1 line
ta/command-list-guides-sync-lint
Re: [PATCH 1/2] command-list: add gitformat-loose(5) and gitpacking(7)
Quoted 11 lines · Tuomas Ahola
Three 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'.
That leaves only
gitweb.conf(5)which could be added to 'userinterfaces'. However, the manual would then appear as "web.conf" ingit help -awhich is just confusing. So, perhaps we are better off by leaving it out.
Quoted 4 lines
Signed-off-by Tuomas Ahola <[email protected]>--- command-list.txt | 2 ++ 1 file changed, 2 insertions(+)
Good eyes. Thanks.
Quoted 21 lines
command-list.txt +2
-0@@ -225,6 +225,7 @@ gitformat-bundle developerinterfaces gitformat-chunk developerinterfaces gitformat-commit-graph developerinterfaces gitformat-index developerinterfaces +gitformat-loose developerinterfaces gitformat-pack developerinterfaces gitformat-signature developerinterfaces gitglossary guide@@ -234,6 +235,7 @@ gitk mainporcelain gitmailmap userinterfaces gitmodules userinterfaces gitnamespaces guide +gitpacking guide gitprotocol-capabilities developerinterfaces gitprotocol-common developerinterfaces gitprotocol-http developerinterfaces
PATCH 2/2 lint-docs: check the guide list in command-list.txt
In reply to Tuomas AholaSince 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.
---
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(-)
Documentation/Makefile +2 -0
@@ -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)
Documentation/lint-manpages.sh +6 -3
@@ -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
Signature · 1 line
ta/command-list-guides-sync-lint
Re: [PATCH 2/2] lint-docs: check the guide list in command-list.txt
Documentation/lint-manpages.sh line 6
Quoted 5 lines · Tuomas Ahola
extract_variable() {Documentation/lint-manpages.sh +2
-1+ file=${2:-../Makefile} ( - cat ../Makefile + cat $file
Now you are allowing arbitrary path to be fed to this function, you should prepare to accept arbitrary path, without assuming that $file has no $IFS whitespaces. I.e.,
cat "$file"
Documentation/lint-manpages.sh line 12
Quoted 3 lines
Documentation/lint-manpages.sh +1
-1) | - make -C .. -f - print_variable 2>/dev/null | + make -C $(dirname $file) -f - print_variable 2>/dev/null |
Ditto. $file itself may have $IFS whitespaces, and the result of running dirname on it may too.
v2 cover guides: keep Documentation/Makefile and command-list.txt in sync
In reply to Tuomas AholaDocumentation/lint-manpages.sh was expanded with a new test ensuring that command-list.txt also includes all non-command manual pages (concept guides and interface manuals).
Based on kh/doc-datamodel.
Changes in v2:
* [1/2]: Use command-list.txt as the area identifier.
* [2/2]: Protect variables againtst whitespace breakage per review comment.
Tuomas Ahola (2):
command-list.txt: add gitformat-loose(5) and gitpacking(7)
lint-docs: check the guide list in command-list.txt
Documentation/Makefile | 2 ++ Documentation/lint-manpages.sh | 10 +++++++--- command-list.txt | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-)
Intervall-diff mot v1:
1: 014da7fdff ! 1: cb6ce6cad1 command-list: add gitformat-loose(5) and gitpacking(7)
@@ Metadata
Author: Tuomas Ahola <[email protected]>
## Commit message ##
- command-list: add gitformat-loose(5) and gitpacking(7)
+ command-list.txt: add gitformat-loose(5) and gitpacking(7)
Three manpages from sections 5 and 7 are not featured in command-list.txt as concept guides or interface manuals.
2: b24d96f732 ! 2: 2dc1ee4514 lint-docs: check the guide list in command-list.txt
@@ Documentation/lint-manpages.sh
extract_variable () {
+ file=${2:-../Makefile}
++ directory=$(dirname "$file")
(
- cat ../Makefile
-+ cat $file
++ 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 |
++ make -C "$directory" -f - print_variable 2>/dev/null |
sed -n -e 's/.*XXX \(.*\) YYY.*/\1/p'
}base-commit: b8242b093d9e941a34460d715e3ce616a34ac3fe
Signature · 1 line
ta/command-list-guides-sync-lint
PATCH v2 1/2 command-list.txt: add gitformat-loose(5) and gitpacking(7)
Three 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'.
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.
--- command-list.txt | 2 ++ 1 file changed, 2 insertions(+)
command-list.txt +2 -0
@@ -224,6 +224,7 @@ gitformat-bundle developerinterfaces gitformat-chunk developerinterfaces gitformat-commit-graph developerinterfaces gitformat-index developerinterfaces +gitformat-loose developerinterfaces gitformat-pack developerinterfaces gitformat-signature developerinterfaces gitglossary guide
@@ -233,6 +234,7 @@ gitk mainporcelain gitmailmap userinterfaces gitmodules userinterfaces gitnamespaces guide +gitpacking guide gitprotocol-capabilities developerinterfaces gitprotocol-common developerinterfaces gitprotocol-http developerinterfaces
Signature · 1 line
ta/command-list-guides-sync-lint
PATCH v2 2/2 lint-docs: check the guide list in command-list.txt
In reply to Tuomas AholaSince 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.
---
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 | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-)
Documentation/Makefile +2 -0
@@ -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)
Documentation/lint-manpages.sh +7 -3
@@ -1,21 +1,23 @@ #!/bin/sh extract_variable () { + file=${2:-../Makefile} + directory=$(dirname "$file") ( - 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 "$directory" -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 +31,7 @@ check_missing_docs () ( git-stage) continue;; git-legacy-*) continue;; git-?*--?* ) continue ;; + gitweb.conf) continue ;; esac if ! test -f "$v.adoc"
@@ -87,6 +90,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
Signature · 1 line
ta/command-list-guides-sync-lint
v3 cover guides: keep Documentation/Makefile and command-list.txt in sync
In reply to Tuomas AholaA 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 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 againtst whitespace breakage per review comment.
synthetic-base: master + je/doc-remove-gittutorial-2
Tuomas Ahola (2):
command-list.txt: add gitformat-loose(5) and gitpacking(7)
lint-docs: check the guide list in command-list.txt
Documentation/Makefile | 2 ++ Documentation/lint-manpages.sh | 11 ++++++++--- command-list.txt | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-)
Intervall-diff mot v2:
1: cb6ce6cad1 = 1: 9a1ba61ac0 command-list.txt: add gitformat-loose(5) and gitpacking(7)
2: 2dc1ee4514 ! 2: 5d36d75859 lint-docs: check the guide list in command-list.txt
@@ Commit message
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.
+ against them. Exempt gitweb.conf(5) and gittutorial-2(7) from the
+ new linter routine.
Signed-off-by: Tuomas Ahola <[email protected]>
@@ Documentation/lint-manpages.sh
#!/bin/sh
extract_variable () {
-+ file=${2:-../Makefile}
-+ directory=$(dirname "$file")
++ file="${2:-../Makefile}"
++ directory="$(dirname "$file")"
(
- cat ../Makefile
+ cat "$file"
@@ Documentation/lint-manpages.sh: check_missing_docs () (
git-stage) continue;;
git-legacy-*) continue;;
git-?*--?* ) continue ;;
++ gittutorial-2) continue ;;
+ gitweb.conf) continue ;;
esacbase-commit: b9e5cff1803ab24582201ef059516eb16014b9d9
prerequisite-patch-id: 7f3cc00ab656bf1192d93c2e6a434c0d0fda2b6b
prerequisite-patch-id: eb8fbd9fc3f96e3cbffddbeaf47b99f397e5330b
Signature · 1 line
ta/command-list-guides-sync-lint
PATCH v3 1/2 command-list.txt: add gitformat-loose(5) and gitpacking(7)
Three 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'.
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.
--- command-list.txt | 2 ++ 1 file changed, 2 insertions(+)
command-list.txt +2 -0
@@ -225,6 +225,7 @@ gitformat-bundle developerinterfaces gitformat-chunk developerinterfaces gitformat-commit-graph developerinterfaces gitformat-index developerinterfaces +gitformat-loose developerinterfaces gitformat-pack developerinterfaces gitformat-signature developerinterfaces gitglossary guide
@@ -234,6 +235,7 @@ gitk mainporcelain gitmailmap userinterfaces gitmodules userinterfaces gitnamespaces guide +gitpacking guide gitprotocol-capabilities developerinterfaces gitprotocol-common developerinterfaces gitprotocol-http developerinterfaces
Signature · 1 line
ta/command-list-guides-sync-lint
Re: [PATCH v3 1/2] command-list.txt: add gitformat-loose(5) and gitpacking(7)
Quoted 11 lines · Tuomas Ahola
Three 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'.
That leaves only
gitweb.conf(5)which could be added to 'userinterfaces'. However, the manual would then appear as "web.conf" ingit help -awhich is just confusing. So, perhaps we are better off by leaving it out.
Quoted 4 lines
Signed-off-by Tuomas Ahola <[email protected]>--- command-list.txt | 2 ++ 1 file changed, 2 insertions(+)
I agree we can decide what to do about gitweb. Is the list otherwise complete to cover the available documents in .adoc format?
Thanks.
Quoted 21 lines
command-list.txt +2
-0@@ -225,6 +225,7 @@ gitformat-bundle developerinterfaces gitformat-chunk developerinterfaces gitformat-commit-graph developerinterfaces gitformat-index developerinterfaces +gitformat-loose developerinterfaces gitformat-pack developerinterfaces gitformat-signature developerinterfaces gitglossary guide@@ -234,6 +235,7 @@ gitk mainporcelain gitmailmap userinterfaces gitmodules userinterfaces gitnamespaces guide +gitpacking guide gitprotocol-capabilities developerinterfaces gitprotocol-common developerinterfaces gitprotocol-http developerinterfaces
Re: [PATCH v3 1/2] command-list.txt: add gitformat-loose(5) and gitpacking(7)
Quoted 13 lines · Junio C Hamano
Quoted 11 lines · Tuomas Ahola
Three 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'.
That leaves only
gitweb.conf(5)which could be added to 'userinterfaces'. However, the manual would then appear as "web.conf" ingit help -awhich is just confusing. So, perhaps we are better off by leaving it out.
Quoted 8 lines
Quoted 4 lines
Signed-off-by Tuomas Ahola <[email protected]>--- command-list.txt | 2 ++ 1 file changed, 2 insertions(+)I agree we can decide what to do about gitweb. Is the list otherwise complete to cover the available documents in .adoc format?
AFAIK, yes.
PATCH v3 2/2 lint-docs: check the guide list in command-list.txt
In reply to Tuomas AholaSince 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) and gittutorial-2(7) from the new linter routine.
--- Documentation/Makefile | 2 ++ Documentation/lint-manpages.sh | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-)
Documentation/Makefile +2 -0
@@ -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)
Documentation/lint-manpages.sh +8 -3
@@ -1,21 +1,23 @@ #!/bin/sh extract_variable () { + file="${2:-../Makefile}" + directory="$(dirname "$file")" ( - 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 "$directory" -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 +31,8 @@ check_missing_docs () ( git-stage) continue;; git-legacy-*) continue;; git-?*--?* ) continue ;; + gittutorial-2) continue ;; + gitweb.conf) continue ;; esac if ! test -f "$v.adoc"
@@ -87,6 +91,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
Signature · 1 line
ta/command-list-guides-sync-lint
Re: [PATCH v3 2/2] lint-docs: check the guide list in command-list.txt
Quoted 34 lines · Tuomas Ahola
Since
2135e1ad70(command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers', 2020-08-05) there has been a comment inDocumentation/Makefilereminding developers to add new guides also to command-list.txt. However, there is no linter script to enforce that.Adapt
Documentation/lint-manpages.shto fill that role. ExtractMAN5_TXTandMAN7_TXTfrom theMakefileand check command-list.txt against them. Exemptgitweb.conf(5)and gittutorial-2(7) from the new linter routine.Signed-off-by Tuomas Ahola <[email protected]>--- Documentation/Makefile | 2 ++ Documentation/lint-manpages.sh | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-)Documentation/Makefile +2
-0@@ -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)Documentation/lint-manpages.sh +0
-0
Documentation/lint-manpages.sh line 4
Quoted 4 lines
Documentation/lint-manpages.sh +1
-0@@ -1,21 +1,23 @@ #!/bin/sh extract_variable () { + file="${2:-../Makefile}"
I think what's happening here is that previously we were getting the variables from ./Makefile (in the basedir), but now we need some variables from ./Makefile and some from Documentation/Makefile.
Would it make sense to get all the variables from Documentation/Makefile?
Quoted 41 lines
Documentation/lint-manpages.sh +7
-3+ directory="$(dirname "$file")" ( - 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 "$directory" -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 +31,8 @@ check_missing_docs () ( git-stage) continue;; git-legacy-*) continue;; git-?*--?* ) continue ;; + gittutorial-2) continue ;; + gitweb.conf) continue ;; esac if ! test -f "$v.adoc"@@ -87,6 +91,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_docsSignature · 1 line
ta/command-list-guides-sync-lint
Re: [PATCH v3 2/2] lint-docs: check the guide list in command-list.txt
Quoted 8 lines · Julia Evans
Quoted 7 lines · Tuomas Ahola
Documentation/lint-manpages.sh +0
-0@@ -1,21 +1,23 @@ #!/bin/sh
Quoted 9 lines
Documentation/lint-manpages.sh line 4
Quoted 2 lines
Documentation/lint-manpages.sh +1
-0extract_variable () { + file="${2:-../Makefile}"I think what's happening here is that previously we were getting the variables from ./Makefile (in the basedir), but now we need some variables from ./Makefile and some from
Documentation/Makefile.Would it make sense to get all the variables from
Documentation/Makefile?
If that's possible, then sure, why not. But I think we are mostly extracting from the top-level Makefile such information that simply isn't available in the docs Makefile (and vice versa)?
Quoted 41 lines
Quoted 41 lines
Documentation/lint-manpages.sh +7
-3+ directory="$(dirname "$file")" ( - 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 "$directory" -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 +31,8 @@ check_missing_docs () ( git-stage) continue;; git-legacy-*) continue;; git-?*--?* ) continue ;; + gittutorial-2) continue ;; + gitweb.conf) continue ;; esac if ! test -f "$v.adoc"@@ -87,6 +91,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_docsSignature · 1 line
ta/command-list-guides-sync-lint
Re: [PATCH v3 2/2] lint-docs: check the guide list in command-list.txt
In reply to Tuomas AholaDocumentation/lint-manpages.sh line 13
Quoted 13 lines · Tuomas Ahola
extract_variable() {Documentation/lint-manpages.sh +4
-2+ file="${2:-../Makefile}" + directory="$(dirname "$file")" ( - 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 "$directory" -f - print_variable 2>/dev/null |
I like this sayIt pattern to prepend a snippet in front of the Makefile. As we allow extracting from different Makefile with this change, it would make more sense to (1) make the path to the Makefile mandatory, (2) move the path to the Makefile first, and (3) use not just the $1 but all the remainder of the command line as listing the symbols we are inquiring.
which would mean ...
Documentation/lint-manpages.sh check_extraneous_docs () { · line 94
Quoted 5 lines
Documentation/lint-manpages.sh +1
-0@@ -87,6 +91,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)"
These would become
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 MAN_GUIDES)"Other than that, looking good.
Thanks.
Re: [PATCH v3 2/2] lint-docs: check the guide list in command-list.txt
Quoted 14 lines · Junio C Hamano
Quoted 12 lines · Tuomas Ahola
extract_variable() {Documentation/lint-manpages.sh +3
-2+ file="${2:-../Makefile}" + directory="$(dirname "$file")" ( - 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 |
Quoted 9 lines
Documentation/lint-manpages.sh line 13
Quoted 1 line
Documentation/lint-manpages.sh +1
-0+ make -C "$directory" -f - print_variable 2>/dev/null |I like this sayIt pattern to prepend a snippet in front of the
Makefile. As we allow extracting from differentMakefilewith this change, it would make more sense to (1) make the path to theMakefilemandatory, (2) move the path to theMakefilefirst, and (3) use not just the $1 but all the remainder of the command line as listing the symbols we are inquiring.
Hmm, sounds sensible.
Quoted 10 lines
which would mean ...
Documentation/lint-manpages.sh check_extraneous_docs () { · line 94
Quoted 5 lines
Documentation/lint-manpages.sh +1
-0@@ -87,6 +91,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)"These would become
Quoted 5 lines
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 MAN_GUIDES)"Okay, I'll do that.
Quoted 5 lines
Other than that, looking good.
Thanks.
v4 cover guides: keep Documentation/Makefile and command-list.txt in sync
In reply to Tuomas AholaA 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 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.
synthetic-base: master + je/doc-remove-gittutorial-2
Tuomas Ahola (2):
command-list.txt: add gitformat-loose(5) and gitpacking(7)
lint-docs: ensure command-list.txt lists all guides
Documentation/lint-manpages.sh | 29 +++++++++++++++++++---------- command-list.txt | 2 ++ 2 files changed, 21 insertions(+), 10 deletions(-)
Intervall-diff mot v3:
1: 9a1ba61ac0 ! 1: a21c0e2bf7 command-list.txt: add gitformat-loose(5) and gitpacking(7)
@@ command-list.txt: gitformat-bundle developerinterfaces
gitformat-pack developerinterfaces
gitformat-signature developerinterfaces
gitglossary guide
-@@ command-list.txt: gitk mainporcelain
- gitmailmap userinterfaces
+@@ command-list.txt: gitmailmap userinterfaces
+ gitmergeconflicts guide
gitmodules userinterfaces
gitnamespaces guide
+gitpacking guide
2: 5d36d75859 ! 2: 4e41401866 lint-docs: check the guide list in command-list.txt
@@ Metadata
Author: Tuomas Ahola <[email protected]>
## Commit message ##
- lint-docs: check the guide list in command-list.txt
+ lint-docs: ensure command-list.txt lists all guides
Since 2135e1ad70 (command-list.txt: add missing 'gitcredentials' and
'gitremote-helpers', 2020-08-05) there has been a comment in
@@ Commit message
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
+ 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.
+ new linter routine as deliberate omissions.
Signed-off-by: Tuomas Ahola <[email protected]>
- ## Documentation/Makefile ##
-@@ Documentation/Makefile: 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)
-
## Documentation/lint-manpages.sh ##
@@
#!/bin/sh
extract_variable () {
-+ file="${2:-../Makefile}"
-+ directory="$(dirname "$file")"
- (
+- (
- cat ../Makefile
-+ cat "$file"
- cat <<EOF
+- 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 |
-+ make -C "$directory" -f - print_variable 2>/dev/null |
- sed -n -e 's/.*XXX \(.*\) YYY.*/\1/p'
+- 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
}
check_missing_docs () (
@@ 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)"
-+MAN_GUIDES="$(extract_variable MAN_GUIDES ./Makefile)"
+ )
+ }
+
+-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//')"
findings=$(
if ! check_missing_docsbase-commit: 0ffa3e35c7c82ab8d0de226149fb03b3f7674d05
Signature · 1 line
ta/command-list-guides-sync-lint
PATCH v4 1/2 command-list.txt: add gitformat-loose(5) and gitpacking(7)
Three 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'.
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.
--- command-list.txt | 2 ++ 1 file changed, 2 insertions(+)
command-list.txt +2 -0
@@ -225,6 +225,7 @@ gitformat-bundle developerinterfaces gitformat-chunk developerinterfaces gitformat-commit-graph developerinterfaces gitformat-index developerinterfaces +gitformat-loose developerinterfaces gitformat-pack developerinterfaces gitformat-signature developerinterfaces gitglossary guide
@@ -235,6 +236,7 @@ gitmailmap userinterfaces gitmergeconflicts guide gitmodules userinterfaces gitnamespaces guide +gitpacking guide gitprotocol-capabilities developerinterfaces gitprotocol-common developerinterfaces gitprotocol-http developerinterfaces
Signature · 1 line
ta/command-list-guides-sync-lint
Re: [PATCH v4 1/2] command-list.txt: add gitformat-loose(5) and gitpacking(7)
Quoted 2 lines · Tuomas Ahola
Three manpages from sections 5 and 7 are not featured in command-list.txt as concept guides or interface manuals.
Since this series is now based after the removal of gittutorial-2(7) from command-list.txt while its stub remains in MAN7_TXT in Documentation/Makefile, there are actually four section 5 and 7 manpages missing from command-list.txt (gitformat-loose(5), gitpacking(7), gitweb.conf(5), and the obsolete gittutorial-2(7) stub).
Updating the count and mentioning gittutorial-2(7) alongside gitweb.conf(5) here would keep the log consistent with patch 2/2.
Quoted 7 lines
As easy fixes, add gitformat-loose(5) to 'developerinterfaces' and make gitpacking(7) a 'guide'.
That leaves only
gitweb.conf(5)which could be added to 'userinterfaces'. However, the manual would then appear as "web.conf" ingit help -awhich is just confusing. So, perhaps we are better off by leaving it out.
The above matches help.c:drop_prefix(), which strips the "git" prefix for CAT_userinterfaces (unlike commands, where it strips "git-"). "gitweb.conf" would indeed show up as "web.conf" in both "git help -a" and "git help --user-interfaces". Leaving it out is a sensible workaround, at least for now.
By the way, plain single quotes 'git help -a' instead of backticks are preferred in the commit messages. Nobody passes these proposed log messages through AsciiDoc or Markdown processors, and they are supposed to be pure text.
Quoted 18 lines
Signed-off-by Tuomas Ahola <[email protected]>--- command-list.txt | 2 ++ 1 file changed, 2 insertions(+)command-list.txt +1
-0@@ -225,6 +225,7 @@ gitformat-bundle developerinterfaces gitformat-chunk developerinterfaces gitformat-commit-graph developerinterfaces gitformat-index developerinterfaces +gitformat-loose developerinterfaces gitformat-pack developerinterfaces gitformat-signature developerinterfaces gitglossary guide
command-list.txt gitmailmap userinterfaces · line 242
Quoted 7 lines
command-list.txt +1
-0@@ -235,6 +236,7 @@ gitmailmap userinterfaces gitmergeconflicts guide gitmodules userinterfaces gitnamespaces guide +gitpacking guide gitprotocol-capabilities developerinterfaces gitprotocol-common developerinterfaces gitprotocol-http developerinterfaces
Both entries are placed in the right alphabetical spots and match the existing categories
Their NAME lines in Documentation/gitformat-loose.adoc and Documentation/gitpacking.adoc already match the expected "<name> - <Capitalized description>" format consumed by tools/generate-cmdlist.sh and Documentation/cmd-list.sh.
Aside from refreshing the commit message for gittutorial-2(7), this step looks good.
Thanks.
Re: [PATCH v4 1/2] command-list.txt: add gitformat-loose(5) and gitpacking(7)
Quoted 7 lines · Junio C Hamano
Quoted 5 lines · Tuomas Ahola
[snip]
That leaves onlygitweb.conf(5)which could be added to 'userinterfaces'. However, the manual would then appear as "web.conf" ingit help -awhich is just confusing. So, perhaps we are better off by leaving it out.
Quoted 6 lines
[snip]
By the way, plain single quotes 'git help -a' instead of backticks are preferred in the commit messages. Nobody passes these proposed log messages through AsciiDoc or Markdown processors, and they are supposed to be pure text.
I use backticks in commit messags for my own personal work just because I prefer the look. So it’s not for some markup language. And in that sense using `, ', or " are all equally pseudo-markup.
The only time I actively dislike no quoting at all is when the code part is a simple and commonplace word and the context makes the sentence read weird enough for me to do a double take.
Quoted 1 line
[snip]
Re: [PATCH v4 1/2] command-list.txt: add gitformat-loose(5) and gitpacking(7)
Quoted 6 lines · Kristoffer Haugsbakk
Quoted 4 lines
By the way, plain single quotes 'git help -a' instead of backticks are preferred in the commit messages. Nobody passes these proposed log messages through AsciiDoc or Markdown processors, and they are supposed to be pure text.
I use backticks in commit messags for my own personal work just because
Surely you may have your own reason to use whategver in your personal work. I won't try to dictate what you would use there ;-)
Thanks.
PATCH v4 2/2 lint-docs: ensure command-list.txt lists all guides
In reply to Tuomas AholaSince 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 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.
--- Documentation/lint-manpages.sh | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-)
Documentation/lint-manpages.sh +19 -10
@@ -1,21 +1,27 @@ #!/bin/sh 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 } 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 +35,8 @@ check_missing_docs () ( git-stage) continue;; git-legacy-*) continue;; git-?*--?* ) continue ;; + gittutorial-2) continue ;; + gitweb.conf) continue ;; esac if ! test -f "$v.adoc"
@@ -84,9 +92,10 @@ 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//')" findings=$( if ! check_missing_docs
Signature · 1 line
ta/command-list-guides-sync-lint
Re: [PATCH v4 2/2] lint-docs: ensure command-list.txt lists all guides
Quoted 27 lines · Tuomas Ahola
Since
2135e1ad70(command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers', 2020-08-05) there has been a comment inDocumentation/Makefilereminding developers to add new guides also to command-list.txt. However, there is no linter script to enforce that.Adapt
Documentation/lint-manpages.shto fill that role. ExtractMAN5_TXTandMAN7_TXTfrom the docsMakefileand check command-list.txt against them. Exemptgitweb.conf(5)and gittutorial-2(7) from the new linter routine as deliberate omissions.Signed-off-by Tuomas Ahola <[email protected]>--- Documentation/lint-manpages.sh | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-)Documentation/lint-manpages.sh +1
-3@@ -1,21 +1,27 @@ #!/bin/sh extract_variable () { - ( - cat ../Makefile - cat <<EOF + file="$1"
Documentation/lint-manpages.sh line 14
Quoted 10 lines
Documentation/lint-manpages.sh +7
-0+ directory="$(dirname "$file")" + shift + for i in "$@" + do + ( + cat "$file" + cat <<EOF print_variable: @\$(foreach b,\$($1),echo XXX \$(b:\$X=) YYY;) EOF
Well, that is obviously incorrect. Sorry. Besides, $i isn't a very eloquent name for the iterator...
Junio, could you please squash this locally?
-----8<-----
Subject: [PATCH] fixup! lint-docs: ensure command-list.txt lists all guides
--- Documentation/lint-manpages.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/lint-manpages.sh +2 -2
@@ -4,13 +4,13 @@ extract_variable () { file="$1" directory="$(dirname "$file")" shift - for i in "$@" + for v in "$@" do ( cat "$file" cat <<EOF print_variable: - @\$(foreach b,\$($1),echo XXX \$(b:\$X=) YYY;) + @\$(foreach b,\$($v),echo XXX \$(b:\$X=) YYY;) EOF ) | make -C "$directory" -f - print_variable 2>/dev/null |
base-commit: 0ffa3e35c7c82ab8d0de226149fb03b3f7674d05
prerequisite-patch-id: 55e8c49f2de1f1bbd117386712fd07a30f2641c7
prerequisite-patch-id: d5b07233f2f991f22c53c1a177690660f8f463ab
Signature · 1 line
fixup/ta/command-list-guides-sync-lint
Re: [PATCH v4 2/2] lint-docs: ensure command-list.txt lists all guides
In reply to Tuomas AholaQuoted 5 lines · Tuomas Ahola
Documentation/lint-manpages.sh +0
-0
Documentation/lint-manpages.sh line 6
Quoted 9 lines
Documentation/lint-manpages.sh +3
-3@@ -1,21 +1,27 @@ #!/bin/sh extract_variable () { - ( - cat ../Makefile - cat <<EOF + file="$1" + directory="$(dirname "$file")" + shift
The first argument to the function becomes $file and then is used to compute $directory; and we shift it out and loop over the remaining arguments.
Documentation/lint-manpages.sh line 14
Quoted 8 lines
Documentation/lint-manpages.sh +5
-0+ for i in "$@" + do + ( + cat "$file" + cat <<EOF print_variable: @\$(foreach b,\$($1),echo XXX \$(b:\$X=) YYY;) EOF
The fact that this patch does not touch these three lines gives a strong smell, especially the reference to "$1", which was part of a single addition to the target Makefile to ask what value an arbitrary single variable has, dating back to 2dd100c513 (Makefile: extract script to lint missing/extraneous manpages, 2024-06-06). Now that you are looping over a list of variable names in "$@" using "for i in ...", shouldn't it refer to "$i" instead?
Because 'for i in "$@"' does not alter the positional parameters, "$1" inside the heredoc stays bound to the first variable name on every iteration. When the script later runs
MAN_GUIDES="$(extract_variable Makefile MAN5_TXT MAN7_TXT |
sed -e 's/\.adoc//')"extract_variable() invokes make twice with $(MAN5_TXT) both times and never evaluates $(MAN7_TXT). None of the section 7 guides (including gitpacking and gittutorial-2) are ever visited by check_missing_docs() because of this, I suspect. Have you tried introducing discrepancies to section 7 entries and seeing if your version detects them?
Even better, instead of running make multiple times, use something like this (warning: totally untested)
vars="$*"
(
cat "$file"
sed -e "s/^|//" <<-EOF
|print_variable:
| @\$(foreach b,\$(foreach v,$vars,\$(\$(v))),echo XXX \$(b:\$X=) YYY;)
EOF
) |
make -C "$directory" -f - print_variable 2>/dev/null |
sed -n -e 's/.*XXX \(.*\) YYY.*/\1/pperhaps?
Unlike "make -f -" that feeds the top-level Makefile, Documentation/Makefile has a conditional include of "doc.dep" unless we are running "make clean". And doc.dep has a rule that depends on $(docdep_prereqs), which includes cmd-list.made.
Does that mean running lint-manpages.sh in a clean tree causes us to build doc.dep while it attempts to extract MAN5_TXT and MAN7_TXT and/or fails the build altogether (we cannot see, due to "2>/dev/null" in the above script, the error message)? Have you tried?
It might be less error-prone than the above gymnastics to add a new print-guides target to Documentation/Makefile, next to where it defines the print-man1 target, imitating how the print-man1 target does its thing.
Quoted 18 lines
Documentation/lint-manpages.sh +5
-4- ) | - 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 } 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;;
Documentation/lint-manpages.sh check_missing_docs () ( · line 40
Quoted 6 lines
Documentation/lint-manpages.sh +2
-0@@ -29,6 +35,8 @@ check_missing_docs () ( git-stage) continue;; git-legacy-*) continue;; git-?*--?* ) continue ;; + gittutorial-2) continue ;; + gitweb.conf) continue ;; esac
Placing gittutorial-2 and gitweb.conf in the top case statement skips the "test -f $v.adoc" check as well as the command-list.txt lookup.
Moving those two arms down into the inner 'case "$v" in git) ...' block would exempt them from command-list.txt while still catching a stale entry in MAN5_TXT or MAN7_TXT whose '.adoc' file disappeared. I do not know which is more appropriate for these two entries.
Documentation/lint-manpages.sh check_extraneous_docs () { · line 97
Quoted 12 lines
Documentation/lint-manpages.sh +3
-3if ! test -f "$v.adoc"@@ -84,9 +92,10 @@ 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)"
Note that all three above read variables from somebody else; running an extra "make" process might be warranted. But ...
Documentation/lint-manpages.sh check_extraneous_docs () { · line 98
Quoted 1 line
Documentation/lint-manpages.sh +1
-0+MAN_GUIDES="$(extract_variable Makefile MAN5_TXT MAN7_TXT | sed -e 's/\.adoc//')"
... here, you are asking for the values of variables that are defined in *this* Makefile. Why can't you inspect $(MAN5_TXT) and $(MAN7_TXT) yourself, e.g.,
MAN_GUIDES=$(patsubst %.adoc,%,$(MAN5_TXT) $(MAN7_TXT))
or something?
It might mean that almost all the things I discussed in this review, including all the changes to the extract_variable() procedure or the addition of the print-guides target, were unnecessary. It is great if we have to worry about fewer things going wrong ;-).
Thanks.
Re: [PATCH v4 2/2] lint-docs: ensure command-list.txt lists all guides
Quoted 9 lines · Junio C Hamano
Quoted 7 lines · Tuomas Ahola
Documentation/lint-manpages.sh +0
-0@@ -1,21 +1,27 @@ #!/bin/sh
Quoted 12 lines
Documentation/lint-manpages.sh line 6
Quoted 7 lines
Documentation/lint-manpages.sh +3
-3extract_variable () { - ( - cat ../Makefile - cat <<EOF + file="$1" + directory="$(dirname "$file")" + shiftThe first argument to the function becomes $file and then is used to compute $directory; and we shift it out and loop over the remaining arguments.
Yep.
Quoted 9 lines
Documentation/lint-manpages.sh line 14
Quoted 8 lines
Documentation/lint-manpages.sh +5
-0+ for i in "$@" + do + ( + cat "$file" + cat <<EOF print_variable: @\$(foreach b,\$($1),echo XXX \$(b:\$X=) YYY;) EOF
Quoted 8 lines
The fact that this patch does not touch these three lines gives a strong smell, especially the reference to "$1", which was part of a single addition to the target
Makefileto ask what value an arbitrary single variable has, dating back to2dd100c513(Makefile: extract script to lint missing/extraneous manpages, 2024-06-06). Now that you are looping over a list of variable names in "$@" using "for i in ...", shouldn't it refer to "$i" instead?
Yes, I already noticed that blunder (cf. <20261127103346.vPrBT%[email protected]>)
Quoted 7 lines
Because 'for i in "$@"' does not alter the positional parameters, "$1" inside the heredoc stays bound to the first variable name on every iteration. When the script later runs
MAN_GUIDES="$(extract_variable Makefile MAN5_TXT MAN7_TXT | sed -e 's/\.adoc//')"
Quoted 7 lines
extract_variable()invokes make twice with $(MAN5_TXT) both times and never evaluates $(MAN7_TXT). None of the section 7 guides (including gitpacking and gittutorial-2) are ever visited bycheck_missing_docs()because of this, I suspect. Have you tried introducing discrepancies to section 7 entries and seeing if your version detects them?
I did all that when I first wrote that reroll. However, my draft used 'shift' in the loop which looked a bit funny when I revisited the patch and sent it out. Obviously I should have replaced $i with $i when I dropped that shift.
Quoted 14 lines
Even better, instead of running make multiple times, use something like this (warning: totally untested)
vars="$*" ( cat "$file" sed -e "s/^|//" <<-EOF |print_variable: | @\$(foreach b,\$(foreach v,$vars,\$(\$(v))),echo XXX \$(b:\$X=) YYY;) EOF ) | make -C "$directory" -f - print_variable 2>/dev/null | sed -n -e 's/.*XXX \(.*\) YYY.*/\1/p
Quoted 2 lines
perhaps?
Hmm, I think I decided against something like that but perhaps I should reconsider that option.
Quoted 10 lines
Unlike "make -f -" that feeds the top-level
Makefile,Documentation/Makefilehas a conditional include of "doc.dep" unless we are running "make clean". And doc.dep has a rule that depends on $(docdep_prereqs), which includes cmd-list.made.Does that mean running
lint-manpages.shin a clean tree causes us to build doc.dep while it attempts to extractMAN5_TXTandMAN7_TXTand/or fails the build altogether (we cannot see, due to "2>/dev/null" in the above script, the error message)? Have you tried?
Good point. That indeed seems to be the case.
Quoted 34 lines
It might be less error-prone than the above gymnastics to add a new print-guides target to
Documentation/Makefile, next to where it defines the print-man1 target, imitating how the print-man1 target does its thing.Quoted 18 lines
Documentation/lint-manpages.sh +5
-4- ) | - 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 } 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;;Documentation/lint-manpages.sh check_missing_docs () ( · line 40
Quoted 6 lines
Documentation/lint-manpages.sh +2
-0@@ -29,6 +35,8 @@ check_missing_docs () ( git-stage) continue;; git-legacy-*) continue;; git-?*--?* ) continue ;; + gittutorial-2) continue ;; + gitweb.conf) continue ;; esacPlacing gittutorial-2 and gitweb.conf in the top case statement skips the "test -f $v.adoc" check as well as the command-list.txt lookup.
Quoted 5 lines
Moving those two arms down into the inner 'case "$v" in git) ...' block would exempt them from command-list.txt while still catching a stale entry in
MAN5_TXTorMAN7_TXTwhose '.adoc' file disappeared. I do not know which is more appropriate for these two entries.
On the other hand, having such stale entries still makes 'make check-docs' barf:
$ rm Documentation/gittutorial-2.adoc && make check-docs make -C Documentation lint-docs make[1]: Entering directory '.../git-docs/Documentation' make[1]: *** No rule to make target 'gittutorial-2.adoc', needed by '.build/lint-docs/man-section-order/gittutorial-2.ok'. Stop. make[1]: Leaving directory '.../git-docs/Documentation' make: *** [Makefile:3984: check-docs] Error 2
Hmm...
Quoted 18 lines
Documentation/lint-manpages.sh check_extraneous_docs () { · line 97
Quoted 12 lines
Documentation/lint-manpages.sh +3
-3if ! test -f "$v.adoc"@@ -84,9 +92,10 @@ 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)"Note that all three above read variables from somebody else; running an extra "make" process might be warranted. But ...
Documentation/lint-manpages.sh check_extraneous_docs () { · line 98
Quoted 1 line
Documentation/lint-manpages.sh +1
-0+MAN_GUIDES="$(extract_variable Makefile MAN5_TXT MAN7_TXT | sed -e 's/\.adoc//')"
Quoted 7 lines
... here, you are asking for the values of variables that are defined in *this*
Makefile. Why can't you inspect $(MAN5_TXT) and $(MAN7_TXT) yourself, e.g.,MAN_GUIDES=$(patsubst %.adoc,%,$(MAN5_TXT) $(MAN7_TXT))or something?
Huh? I'm not sure what you mean by "this" Makefile (this is a shell script, isn't it?)
Oh, I think I got it. Indeed, perhaps we can invoke the script within the Makefile with the guides fed in as command-line parameters:
Documentation/Makefile +2 -2
@@ -532,8 +532,8 @@ $(LINT_DOCS_DOC_STYLE): .build/lint-docs/doc-style/%.ok: %.adoc .PHONY: lint-docs-doc-style lint-docs-doc-style: $(LINT_DOCS_DOC_STYLE) -lint-docs-manpages: - $(QUIET_GEN)./lint-manpages.sh +lint-docs-manpages: $(MAN5_TXT) $(MAN7_TXT) + $(QUIET_GEN)./lint-manpages.sh $(patsubst %.adoc,%,$(MAN5_TXT) $(MAN7_TXT)) .PHONY: lint-docs-meson lint-docs-meson:
I quite like that approach. So, let's make it our plan for v5(?)
Quoted 7 lines
It might mean that almost all the things I discussed in this review, including all the changes to the
extract_variable()procedure or the addition of the print-guides target, were unnecessary. It is great if we have to worry about fewer things going wrong ;-).Thanks.
Thanks!
Re: [PATCH v4 2/2] lint-docs: ensure command-list.txt lists all guides
Documentation/Makefile $(LINT_DOCS_DOC_STYLE): .build/lint-docs/doc-style/%.ok: %.adoc · line 536
Quoted 12 lines · Tuomas Ahola
Documentation/Makefile +2
-2@@ -532,8 +532,8 @@ $(LINT_DOCS_DOC_STYLE): .build/lint-docs/doc-style/%.ok: %.adoc .PHONY: lint-docs-doc-style lint-docs-doc-style: $(LINT_DOCS_DOC_STYLE) -lint-docs-manpages: - $(QUIET_GEN)./lint-manpages.sh +lint-docs-manpages: $(MAN5_TXT) $(MAN7_TXT) + $(QUIET_GEN)./lint-manpages.sh $(patsubst %.adoc,%,$(MAN5_TXT) $(MAN7_TXT))
Yes, exactly. Then extract_variable does not have to change, as it only is used to read from the top-level Makefile. Perhaps this patch will shrink quite a lot.
Thanks.
v5 cover guides: keep Documentation/Makefile and command-list.txt in sync
In reply to Tuomas AholaA 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. <[email protected]>
+
+ ## 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 <[email protected]>
- ## 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_docsbase-commit: 0ffa3e35c7c82ab8d0de226149fb03b3f7674d05
Signature · 1 line
ta/command-list-guides-sync-lint
PATCH v5 1/2 command-list.txt: add gitformat-loose(5) and gitpacking(7)
Four manpages from sections 5 and 7 are not featured in command-list.txt as concept guides or interface manuals.
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].
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. <[email protected]>
---
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 | 2 ++ 1 file changed, 2 insertions(+)
command-list.txt +2 -0
@@ -225,6 +225,7 @@ gitformat-bundle developerinterfaces gitformat-chunk developerinterfaces gitformat-commit-graph developerinterfaces gitformat-index developerinterfaces +gitformat-loose developerinterfaces gitformat-pack developerinterfaces gitformat-signature developerinterfaces gitglossary guide
@@ -235,6 +236,7 @@ gitmailmap userinterfaces gitmergeconflicts guide gitmodules userinterfaces gitnamespaces guide +gitpacking guide gitprotocol-capabilities developerinterfaces gitprotocol-common developerinterfaces gitprotocol-http developerinterfaces
Signature · 1 line
ta/command-list-guides-sync-lint
Re: [PATCH v5 1/2] command-list.txt: add gitformat-loose(5) and gitpacking(7)
Quoted 4 lines · Tuomas Ahola
Four manpages from sections 5 and 7 are not featured in command-list.txt as concept guides or interface manuals.
Two of those omissions are intentional: gittutorial(7) is a mere stub
s/gittutorial/gittutorial-2/ -- d'oh!
Quoted 12 lines
since
bfae357a46(doc: remove gittutorial-2, 2026-10-26), and listinggitweb.conf(5)was explicitly decided against in [1].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. <[email protected]>Signed-off-by Tuomas Ahola <[email protected]>---
PATCH v5 2/2 lint-docs: ensure command-list.txt lists all guides
In reply to Tuomas AholaSince 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, 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.
--- Documentation/Makefile | 3 ++- Documentation/lint-manpages.sh | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-)
Documentation/Makefile +2 -1
@@ -532,8 +532,9 @@ $(LINT_DOCS_DOC_STYLE): .build/lint-docs/doc-style/%.ok: %.adoc .PHONY: lint-docs-doc-style lint-docs-doc-style: $(LINT_DOCS_DOC_STYLE) +.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 +4 -1
@@ -15,7 +15,7 @@ EOF 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 +29,8 @@ check_missing_docs () ( git-stage) continue;; git-legacy-*) continue;; git-?*--?* ) continue ;; + gittutorial-2) 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="$@" findings=$( if ! check_missing_docs
Signature · 1 line
ta/command-list-guides-sync-lint
v6 cover guides: keep Documentation/Makefile and command-list.txt in sync
In reply to Tuomas AholaA 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 v6:
* [1/2]: typofix
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 v5:
1: 6ebae33b99 ! 1: 7f098eee90 command-list.txt: add gitformat-loose(5) and gitpacking(7)
@@ Commit message
Four manpages from sections 5 and 7 are not featured in command-list.txt as concept guides or interface manuals.
- Two of those omissions are intentional: gittutorial(7) is a mere stub
+ Two of those omissions are intentional: gittutorial-2(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].
2: fcc9260153 = 2: f430b8f970 lint-docs: ensure command-list.txt lists all guides
base-commit: 0ffa3e35c7c82ab8d0de226149fb03b3f7674d05
Signature · 1 line
ta/command-list-guides-sync-lint
PATCH v6 1/2 command-list.txt: add gitformat-loose(5) and gitpacking(7)
Four manpages from sections 5 and 7 are not featured in command-list.txt as concept guides or interface manuals.
Two of those omissions are intentional: gittutorial-2(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].
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. <[email protected]>
--- command-list.txt | 2 ++ 1 file changed, 2 insertions(+)
command-list.txt +2 -0
@@ -225,6 +225,7 @@ gitformat-bundle developerinterfaces gitformat-chunk developerinterfaces gitformat-commit-graph developerinterfaces gitformat-index developerinterfaces +gitformat-loose developerinterfaces gitformat-pack developerinterfaces gitformat-signature developerinterfaces gitglossary guide
@@ -235,6 +236,7 @@ gitmailmap userinterfaces gitmergeconflicts guide gitmodules userinterfaces gitnamespaces guide +gitpacking guide gitprotocol-capabilities developerinterfaces gitprotocol-common developerinterfaces gitprotocol-http developerinterfaces
Signature · 1 line
ta/command-list-guides-sync-lint
PATCH v6 2/2 lint-docs: ensure command-list.txt lists all guides
In reply to Tuomas AholaSince 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, 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.
--- Documentation/Makefile | 3 ++- Documentation/lint-manpages.sh | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-)
Documentation/Makefile +2 -1
@@ -532,8 +532,9 @@ $(LINT_DOCS_DOC_STYLE): .build/lint-docs/doc-style/%.ok: %.adoc .PHONY: lint-docs-doc-style lint-docs-doc-style: $(LINT_DOCS_DOC_STYLE) +.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 +4 -1
@@ -15,7 +15,7 @@ EOF 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 +29,8 @@ check_missing_docs () ( git-stage) continue;; git-legacy-*) continue;; git-?*--?* ) continue ;; + gittutorial-2) 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="$@" findings=$( if ! check_missing_docs
Signature · 1 line
ta/command-list-guides-sync-lint