Subject: Re: [PATCH v4] meson: regenerate config-list.h when Documentation changes

From: Junio C Hamano <[email-masked]>
Date: Tue, 17 Feb 2026 12:24:19 -0800

"D. Ben Knoble" <[email-masked]> writes:

>> > +     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?