From: Junio C Hamano Date: Thu, 10 Sep 2026 15:36:59 GMT Subject: Re: [PATCH v4 2/3] advice: introduce advice scoping mechanism Message-ID: In-Reply-To: <20260910085353.109373-3-ub4nal@mail.ru> Vsevolod Myalitsin writes: > @@ -109,8 +117,21 @@ static void vadvise(const char *advice, > strbuf_vaddf(&buf, advice, params); > > if (setting && setting->level == ADVICE_LEVEL_NONE) { > + const char *scope = ""; > + switch (setting->scope_hint) { > + case CONFIG_SCOPE_LOCAL: > + case CONFIG_SCOPE_UNKNOWN: > + break; > + case CONFIG_SCOPE_GLOBAL: > + scope = " --global"; > + break; > + case CONFIG_SCOPE_SYSTEM: > + scope = " --system"; > + break; > + } make DEVELOPER=YesPlease would die due to advice.c: In function 'vadvise': advice.c:123:17: error: enumeration value 'CONFIG_SCOPE_WORKTREE' not handled in switch [-Werror=switch] 123 | switch (setting->scope_hint) { | ^~~~~~ advice.c:123:17: error: enumeration value 'CONFIG_SCOPE_COMMAND' not handled in switch [-Werror=switch] advice.c:123:17: error: enumeration value 'CONFIG_SCOPE_SUBMODULE' not handled in switch [-Werror=switch] We probably should have default: BUG("advice settings at wrong config scope"); or something there. > strbuf_addf(&buf, turn_off_instructions, > - setting->key); > + scope, setting->key); > + } > > for (cp = buf.buf; *cp; cp = np) { > np = strchrnul(cp, '\n');