Re: git silently ignores include directive with single quotes
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Sep 8, 2018, 22:10 UTC
- Message-ID
- <ad56c575-1211-61d2-daed-5b0da61db738@ramsayjones.plus.com>
- In-Reply-To
- <20180908211436.GA31560@sigill.intra.peff.net>
On 08/09/18 22:14, Jeff King wrote:
Show 22 quoted lines
> 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]
Show 9 quoted lines
> 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