git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/1] Hot fix for js/empty-config-section-fix
@ 2018-05-17 21:47 Johannes Schindelin
  2018-05-17 21:47 ` [PATCH 1/1] config: a user-provided invalid section is not a BUG Johannes Schindelin
  2018-05-17 23:00 ` [PATCH 0/1] Hot fix for js/empty-config-section-fix Junio C Hamano
  0 siblings, 2 replies; 3+ messages in thread
From: Johannes Schindelin @ 2018-05-17 21:47 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Junio C Hamano, Jeff King

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] config: a user-provided invalid section is not a BUG
  2018-05-17 21:47 [PATCH 0/1] Hot fix for js/empty-config-section-fix Johannes Schindelin
@ 2018-05-17 21:47 ` Johannes Schindelin
  2018-05-17 23:00 ` [PATCH 0/1] Hot fix for js/empty-config-section-fix Junio C Hamano
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Schindelin @ 2018-05-17 21:47 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Junio C Hamano, Jeff King

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(-)

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/1] Hot fix for js/empty-config-section-fix
  2018-05-17 21:47 [PATCH 0/1] Hot fix for js/empty-config-section-fix Johannes Schindelin
  2018-05-17 21:47 ` [PATCH 1/1] config: a user-provided invalid section is not a BUG Johannes Schindelin
@ 2018-05-17 23:00 ` Junio C Hamano
  1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2018-05-17 23:00 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git, Jeff King

Johannes Schindelin <johannes.schindelin@gmx.de> writes:

> 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.


>
>
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-17 23:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17 21:47 [PATCH 0/1] Hot fix for js/empty-config-section-fix Johannes Schindelin
2018-05-17 21:47 ` [PATCH 1/1] config: a user-provided invalid section is not a BUG Johannes Schindelin
2018-05-17 23:00 ` [PATCH 0/1] Hot fix for js/empty-config-section-fix Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).