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

Re: [PATCH] branch: report kind of checkout when rejecting delete

From
René Scharfe <l.s.r@web.de>
Date
Jul 19, 2026, 05:55 UTC
Message-ID
<20acbbc9-67e0-4b9e-9e4c-9f5dbebccc58@web.de>
In-Reply-To
<xmqqa4roq7a8.fsf@gitster.g>
On 7/19/26 12:09 AM, Junio C Hamano wrote:
Show 18 quoted lines
> René Scharfe <l.s.r@web.de> writes:
> 
>>>> +				int kind = branch_checkout_kind(name);
>>>
>>> Not "enum branch_checkout_kind" but "int"?
>>
>> Yes, it doesn't matter for the switch and is easier to print.
> 
> I do not understand the "print" part.  I was probably in the last
> group of people who was forced to switch from CPP macros to enum
> and their argument was always "'print kind' in GDB gives symbolic
> output".  As "enum" is an glorified "int", wouldn't 
> 
> 	int i_kind;
> 	enum branch_checkout_kind e_kind;
> 	BUG(_("we did not expect %d %d"), e_kind, i_kind);
> 
> do just what we expect?

True, integer promotion makes this work regardless of the underlying type of the enum. It was easier for me to make that conversion explicit than to remember the conversion rule. Which isn't that complicated, though, admittedly.

René
Previous: Junio C HamanoNext: Phillip Wood
Message 5 of 10 in “branch: report kind of checkout when rejecting delete”
  1. branch: report kind of checkout when rejecting deleteRené Scharfe, Jul 18, 2026
  2. Junio C HamanoJul 18, 2026
  3. René ScharfeJul 18, 2026
  4. Junio C HamanoJul 18, 2026
  5. René ScharfeJul 19, 2026
  6. Phillip WoodJul 19, 2026
  7. branch: report active bisect run when rejecting deleteRené Scharfe, Jul 25, 2026
  8. Junio C HamanoJul 26, 2026
  9. Toon ClaesJul 28, 2026
  10. Phillip WoodJul 29, 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.