threads / patch / 48512

patchHot fix for js/empty-config-section-fix

Subject: [PATCH 0/1] Hot fix for js/empty-config-section-fix

## tl;dr

3 messages between May 17, 2018 and May 17, 2018. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Johannes Schindelin· May 17, 2018, 21:47 UTC · lore

In https://public-inbox.org/git/20180508134248.GA25513@sigill.intra.peff.net/ Jeff King pointed out that an invalid config section is not an indicator of a bug, as it is usually provided by the user.

So we should not throw a fit and tell the user about a bug that they might even report.

Instead, let's just error out.
Johannes Schindelin (1):
  config: a user-provided invalid section is not a BUG
 config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
base-commit: ccdcbd54c4475c2238b310f7113ab3075b5abc9c
Published-As: https://github.com/dscho/git/releases/tag/empty-config-section-fix-v1
Fetch-It-Via: git fetch https://github.com/dscho/git empty-config-section-fix-v1
-- 
2.17.0.windows.1.42.gaba71d8cd65
Johannes Schindelin· May 17, 2018, 21:47 UTC · re: Johannes Schindelin · lore

[PATCH 1/1] config: a user-provided invalid section is not a BUG

This was pointed out by Jeff King while the empty-config-section-fix patch series was cooking, and was not addressed in time for that patch series to advance to `master`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to config.c +1 −1
diff --git a/config.c b/config.c
index 6f8f1d8c113..2392a8076b7 100644
--- a/config.c
+++ b/config.c
@@ -2359,7 +2359,7 @@ static int store_aux_event(enum config_event_t type,
 
 	if (type == CONFIG_EVENT_SECTION) {
 		if (cf->var.len < 2 || cf->var.buf[cf->var.len - 1] != '.')
-			BUG("Invalid section name '%s'", cf->var.buf);
+			return error("invalid section name '%s'", cf->var.buf);
 
 		/* Is this the section we were looking for? */
 		store->is_keys_section =
-- 
2.17.0.windows.1.42.gaba71d8cd65
Junio C Hamano· May 17, 2018, 23:00 UTC · re: Johannes Schindelin · lore

Re: [PATCH 0/1] Hot fix for js/empty-config-section-fix

Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 8 quoted lines
> In https://public-inbox.org/git/20180508134248.GA25513@sigill.intra.peff.net/
> Jeff King pointed out that an invalid config section is not an indicator
> of a bug, as it is usually provided by the user.
>
> So we should not throw a fit and tell the user about a bug that they
> might even report.
>
> Instead, let's just error out.
Yeah, makes sense.  Thanks for a prompt fix-up.
Show 12 quoted lines
>
>
> Johannes Schindelin (1):
>   config: a user-provided invalid section is not a BUG
>
>  config.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
>
> base-commit: ccdcbd54c4475c2238b310f7113ab3075b5abc9c
> Published-As: https://github.com/dscho/git/releases/tag/empty-config-section-fix-v1
> Fetch-It-Via: git fetch https://github.com/dscho/git empty-config-section-fix-v1

← back to recent threads