git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/2] checkout: pass program-readable token to unified "main"

From
Patrick Steinhardt <ps@pks.im>
Date
Feb 6, 2026, 16:05 UTC
Message-ID
<aYYROwDxrHU-H3n_@pks.im>
In-Reply-To
<20260129190616.645471-2-gitster@pobox.com>
On Thu, Jan 29, 2026 at 11:06:15AM -0800, Junio C Hamano wrote:
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> index f9453473fe..4f189fde48 100644
> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
[snip]
Show 13 quoted lines
> +	switch (which_command) {
> +	case CHECKOUT_CHECKOUT:
> +		usagestr = checkout_usage;
> +		break;
> +	case CHECKOUT_SWITCH:
> +		usagestr = switch_branch_usage;
> +		break;
> +	case CHECKOUT_RESTORE:
> +		usagestr = restore_usage;
> +		break;
> +	default:
> +		BUG("No such checkout variant %d", which_command);
> +	}

Tiniest nit, really not worth addressing on its own: BUG messages typically start with a lower-case letter.

Other than that I like that we have less global constants with this change.

Patrick
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 11 in “Improving advise messages from "switch"”
  1. 0/2 Improving advise messages from "switch"Junio C Hamano, Jan 27, 2026
  2. 1/2 checkout: pass program-readable token to unified "main"Junio C Hamano, Jan 27, 2026
  3. 2/2 checkout: tell "parse_remote_branch" which command is calling itJunio C Hamano, Jan 27, 2026
  4. Kristoffer HaugsbakkJan 27, 2026
  5. Junio C HamanoJan 27, 2026
  6. 0/2 Improving advise messages from "switch"Junio C Hamano, Jan 29, 2026
  7. 1/2 checkout: pass program-readable token to unified "main"Junio C Hamano, Jan 29, 2026
  8. Patrick SteinhardtFeb 6, 2026
  9. Junio C HamanoFeb 19, 2026
  10. 2/2 checkout: tell "parse_remote_branch" which command is calling itJunio C Hamano, Jan 29, 2026
  11. Patrick SteinhardtFeb 6, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.