From: Jeff King Date: Fri, 11 Sep 2009 22:05:07 GMT Subject: Re: bash_completion outside repo Message-ID: <20090911220506.GA27098@coredump.intra.peff.net> In-Reply-To: <7vr5uduotz.fsf@alter.siamese.dyndns.org> On Fri, Sep 11, 2009 at 02:57:28PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > I think something like that needs to "belong" to the diff code itself. I > > guess in the case of "diff", we could check all diff-related config at > > diff setup time. > > Not necessarily. You do not want to care about color configuration if you are > doing diff --raw for example. The one that first uses the color variable > should be able to notice the breakage, no? > > > But what about something used in several places, like > > core.quotepath? > > Exactly the same way I checked what codepaths needed to fix for the > autosetupmerge stuff. core.quotepath internally sets quote_path_fully, > and the sole user of quote_path_fully is sq_must_quote() which is only > used by next_quote_pos(). So you can have your check very isolated. I guess I'm just worried that in doing this for _every_ variable we are going to run across cases where variables are used in several different codepaths, and we are going to end up adding a large number of tests for "is this thing valid". And if we forget one, it's going to cause us to access some sentinel value that may cause a segfault. But that is just my gut feeling. I haven't actually looked at doing a full-scale conversion. -Peff