Git development
 help / color / mirror / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Phillip Wood <phillip.wood123@gmail.com>,
	Toon Claes <toon@iotcl.com>, Patrick Steinhardt <ps@pks.im>,
	Git List <git@vger.kernel.org>, stsp <stsp2@yandex.ru>
Subject: Re: [PATCH] branch: report kind of checkout when rejecting delete
Date: Sun, 19 Jul 2026 07:55:48 +0200	[thread overview]
Message-ID: <20acbbc9-67e0-4b9e-9e4c-9f5dbebccc58@web.de> (raw)
In-Reply-To: <xmqqa4roq7a8.fsf@gitster.g>

On 7/19/26 12:09 AM, Junio C Hamano wrote:
> 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é


  reply	other threads:[~2026-07-19  5:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-18  4:39 [PATCH] branch: report kind of checkout when rejecting delete René Scharfe
2026-07-18 17:34 ` Junio C Hamano
2026-07-18 19:07   ` René Scharfe
2026-07-18 22:09     ` Junio C Hamano
2026-07-19  5:55       ` René Scharfe [this message]
2026-07-19  9:50       ` Phillip Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20acbbc9-67e0-4b9e-9e4c-9f5dbebccc58@web.de \
    --to=l.s.r@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=phillip.wood123@gmail.com \
    --cc=ps@pks.im \
    --cc=stsp2@yandex.ru \
    --cc=toon@iotcl.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox