Re: [PATCH v2 6/7] config: allow configuration of multiple hook error behavior
From: Jeff King <hidden>
Date: 2019-05-16 05:08:39
On Wed, May 15, 2019 at 11:10:17PM +0000, brian m. carlson wrote:
quoted
An alternative name is onError, probably more often used for event callbacks. But I don't know, maybe errorBehavior is actually better.I'm going to use "errorStrategy", since we already have submodule.alternateErrorStrategy.
That sounds good (and I don't care too much about the name as long as it it is in the per-hook subsection like this).
quoted
should we fall back to hook.errorBehavior? That allows people to set global policy, then customize just a small set of weird hooks.Sure, that sounds good.
I like this, too.
quoted
maybe stop-on-first-error (or if you go with the "onError" name, I think "stop" is enough). I know "stop on/after first hook" does not really make any sense when you think about it. Maybe stop-on-first is sufficient. I was going to suggest strcasecmp. But core.whitespace (also has multiple-word-values) already sets a precedent on strcmp. I think we're good. Or mostly good, I don't know, we still accept False, false and FALSE.I think with errorStrategy, "stop" is fine. Simpler is better. I literally picked what Peff had suggested in his email (mostly because I'm terrible at naming things), and I don't get the impression he spent a great deal of time analyzing the ins and outs of the names before sending. I could be wrong, though.
No, I didn't. :) I think "stop" is good. If the others are report-any-error and report-any-success, then the matching name for this could be report-first-error.
quoted
quoted
+ else if (!strcmp(value, "report-any-error"))I couldn't guess based on this name alone, whether we continue or stop after the reporting part. The 7/7 document makes it clear though. So all good.I'm open to hearing better suggestions if anyone has any.
Maybe report-all-errors would indicate that it was going to run all of the hooks. I dunno. I think the documentation you wrote is plenty clear with the current name. -Peff