Re: [PATCH v4] meson: regenerate config-list.h when Documentation changes
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 17, 2026, 20:24 UTC
- Message-ID
- <xmqq4infazkc.fsf@gitster.g>
- In-Reply-To
- <CALnO6CAGfd2orSzjvxfAYx=xBnB=QdOwT-f5g0pQrcxO_19BGQ@mail.gmail.com>
"D. Ben Knoble" <ben.knoble+github@gmail.com> writes:
Show 11 quoted lines
>> > + for doc in "$SOURCE_DIR"/Documentation/*config.adoc \ >> > + "$SOURCE_DIR"/Documentation/config/*.adoc >> > + do >> > + printf "$OUTPUT: %s\n" "$(printf '%s\n' "$doc" | sed 's/[# ]/\\&/g')" >> >> Tiny nit: can't we simplify this to "$(echo "$doc" | sed ...)"? > > Given how unportable echo is [1], I'd prefer to keep printf. > > [1]: https://github.com/benknoble/echocho, for one. If the doc started > with "-e" for example the results might be unreliable.
To cause trouble, wouldn't it be necessary for "$doc" to be exactly "-e", not "started with"?
And when does $SOURCE_DIR begin with "-e" anyway? It sounds more or less academic irrelevancy.
Whatn I am more curious about is the "#"s and spaces being the only bytes that needs quoting. As SOURCE_DIR pretty much under end-user's control (otherwise you wouldn't be worried about it starting with -e), wouldn't we have other problematic bytes we need to worry about?