Re: [PATCH] Allow built-ins to also use -c var=val via alias
- From
Jeff King <peff@peff.net>
- Date
- May 24, 2011, 22:49 UTC
- Message-ID
- <20110524224903.GA16265@sigill.intra.peff.net>
- In-Reply-To
- <20110524215759.GA24298@sigill.intra.peff.net>
On Tue, May 24, 2011 at 05:57:59PM -0400, Jeff King wrote:
Show 17 quoted lines
> On Tue, May 24, 2011 at 05:52:02PM -0400, Jeff King wrote: > > > On Tue, May 24, 2011 at 05:46:18PM -0400, Jeff King wrote: > > > > > I think the right fix is simply to drop the "don't re-check the > > > environment after the first time" logic. It's not expensive to parse > > > compared to parsing config files, which is when we would do it. We can > > > just drop the existing list and reparse. You can even get rid of the > > > whole list and drop a bunch of code, I think, like: > > > > Ack, wrong patch. That one doesn't even come close to compiling. > > > > Try this (still not well tested, though). > > Ugh, broken. That will teach me to just paste any random junk into my > MUA. Hopefully you got the gist of what I was trying to say, but let me > come up with a more readable and tested series.
OK, for real this time. This is how I would do the whole fix on top of master, including your 1/2. I'll let you handle the apply-to-maint-and-merge as you would have with your original series.
The first two are refactoring to make 3/4 a little easier to read. The third one is my fix, and the fourth is your original patch (together with my 3/4 it passes the test; btw, I ended up writing a slightly simpler test. Feel free to throw it out if you prefer yours).
[1/4]: config: make environment parsing routines static [2/4]: git_config: don't peek at global config_parameters [3/4]: config: always parse GIT_CONFIG_PARAMETERS during git_config [4/4]: handle_options(): do not miscount how many arguments were used
-Peff