Thread (19 messages) flat view 19 messages, 4 authors, 2d ago

Re: [PATCH] advice: use global config for default branch name

From: Junio C Hamano <hidden>
Date: 2026-09-08 18:57:21

Vsevolod Myalitsin [off-list ref] 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);
	}

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help