Web lists-archives.com

Re: git silently ignores include directive with single quotes





On 08/09/18 22:14, Jeff King wrote:
> On Sat, Sep 08, 2018 at 09:54:14PM +0200, Ævar Arnfjörð Bjarmason wrote:
> 
>> The reason missing includes are ignored is that the way this is expected
>> to be used is e.g.:
>>
>>     [include]
>>         path ~/.gitconfig.work
>>
>> Where .gitconfig.work is some configuration you're going to drop into
>> place on your $dayjob servers, but not on your personal machine, even
>> though you sync the same ~/.gitconfig everywhere.
>>
>> A lot of people who use includes rely on this, but I see from this
>> thread this should be better documented.
> 
> Right, this was an intentional choice at the time the feature was added,
> to support this kind of feature. I'd note also that it mirrors other
> misspelled keys. E.g.:
> 
>   [include]
>   psth = whatever
> 
[snip]
> That said, it _does_ behave the same and people are likely depending on
> it at this point. So if we introduce a warning, for example, there needs
> to be some way to suppress it.
> 
> Probably:
> 
>   [include]
>   warnOnMissing = false
>   path = ...

I was going to suggest, inspired by Makefile syntax, that
[-include] would not complain if the file was missing ...
except, of course, it's too late for that! ;-)

I suppose [+include] could complain if the file is missing
instead, ... dunno.

ATB,
Ramsay Jones