From: Junio C Hamano Date: Tue, 08 Sep 2026 18:57:18 GMT Subject: Re: [PATCH] advice: use global config for default branch name Message-ID: In-Reply-To: <20260908213840.37833-1-ub4nal@mail.ru> Vsevolod Myalitsin writes: > Yes, I agree that passing the "advice_setting" itself is cleaner and > more future-proof. I will change "vadvise()" to take a pointer to the > corresponding "advice_setting" instead. One minor glitch is that there is an ad-hoc vadvise() call in advise() that is not tied to any particular entry in the advise_setting[] table. I think we'd need to give a name to the advice_setting struct type, instanciate an ad-hoc instance on stack, and pass it down the callchain, perhaps like so: void advise(const char *advice, ...) { struct advice_setting ad_hoc = { .key = "", .scope = CONFIG_SCOPE_UNKNOWN, .level = 0, }; va_list params; va_start(params, advise); vadvise(advise, &ad_hoc, params); va_end(params); }