Re: [PATCH 01/11] Start to implement a built-in version of `git add --interactive`
- From
Jeff King <peff@peff.net>
- Date
- Apr 18, 2019, 16:06 UTC
- Message-ID
- <20190418160633.GB8054@sigill.intra.peff.net>
- In-Reply-To
- <3149b9ba-2f5a-46ce-ad89-4105ec217795@jeffhostetler.com>
On Thu, Apr 18, 2019 at 10:31:30AM -0400, Jeff Hostetler wrote:
Show 16 quoted lines
> Currently, neither function looks at any other k/v pairs, so
> this is a bit of a moot point, but I'm wondering if this should
> look like this:
>
> int add_config(...)
> {
> // give add-interactive.c a chance to look at k/v pair, but
> // do not short-cut because we don't know yet whether we
> // will be interactive or not yet.
> (void)add_i_config(...);
>
> ...ignore_add_errors...
> ...use_builtin_add_i...
>
> return git_default_config(...);
> }Yeah, I agree this split seems a bit more natural. It is worth propagating errors from add_i_config(), though, like:
if (add_i_config(var, value, data)) return -1;
so that any key-specific errors (e.g., config_error_nonbool) stop the parsing in the usual way.
-Peff