Re: [PATCH v3 2/2] lint-docs: check the guide list in command-list.txt
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 5, 2026, 19:41 UTC
- Message-ID
- <xmqqcxsjt6b3.fsf@gitster.g>
- In-Reply-To
- <20261029184834.2273-3-taahol@utu.fi>
Tuomas Ahola <taahol@utu.fi> writes:
Show 13 quoted lines
> 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 |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 ...
Show 5 quoted lines
> @@ -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.