Re: [PATCH 2/3] config: values of pathname type can be prefixed with :(optional)
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- May 2, 2025, 14:28 UTC
- Message-ID
- <c492a392-8914-4fa3-8356-c583f0a3fa81@gmail.com>
- In-Reply-To
- <aBSHugZcH8NusOcI@pks.im>
On 02/05/2025 09:52, Patrick Steinhardt wrote:
Show 13 quoted lines
> On Thu, May 01, 2025 at 02:40:56PM -0700, Junio C Hamano wrote: > >> ++ >> +If prefixed with `:(optional)`, the configuration variable is treated >> +as if it does not exist, if the named path does not exist or names an >> +empty file. > > I can see why it may be useful to allow for non-existent paths. But I > wonder whether we really should be skipping over empty files, as well, > as it may be assuming too much about the semantics of a given config > key. In other words, are we reasonably sure that there won't ever be a > usecase where you may want to specify an optional and empty file? And > are there any use cases where an empty file should be ignored?
That's my thought too - ignoring a missing file sounds like a good idea but why an empty file too?
Best Wishes
Phillip