From: Junio C Hamano Date: Fri, 11 Sep 2009 22:04:30 GMT Subject: Re: bash_completion outside repo Message-ID: <7vmy51uoi9.fsf@alter.siamese.dyndns.org> In-Reply-To: <7vr5uduotz.fsf@alter.siamese.dyndns.org> Junio C Hamano writes: > 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. Note that I was _not_ defending the approach my illustration took. I merely was pointing out that core.quotepath and diff.color are _not_ valid counterexamples to it. A better counter-proposal would be made something along this line: Currently, core.frotz and nitfol.rezrov both map internally to a variable xyzzy, so config parser could set xyzzy = INVALID_INFOCOM but the user of xyzzy cannot report which configuration variable caused the error with your illustration scheme. Here is my attempt to solve this issue. ...patch follows... And I am sure we will be able to find such examples that my illustration patch is not _exactly_ the best approach to solve pretty easily around remote.*.* and branch.*.* variables.