From: Patrick Steinhardt Date: Fri, 09 Jan 2026 16:32:39 GMT Subject: Re: [PATCH v17 1/2] refactor format_branch_comparison in preparation Message-ID: In-Reply-To: <848006C9-FD1B-4E73-935F-D4A338AF2EC9@gmail.com> On Fri, Jan 09, 2026 at 11:22:33AM -0500, Ben Knoble wrote: > > > Le 9 janv. 2026 à 11:07, Harald Nordgren a écrit : > > > >  > >> > >> Using an enum for a set of flags is a bit confusing. > > > > The point of the flag and the bitmasking is to selectively turn off the push > > and pull advice advice from the relevant branch when the push branch > > comparison is active. > > > > In an earlier implementation the advice logic was moved to the caller > > instead 'format_branch_comparison', but it's more faithful to the original > > to have the advice logic inside 'format_branch_comparison'. Maybe I > > misunderstood your comments around this? > > > > Would happily take a suggestion on a nicer way to handle it. > > I think other uses in Git declare a bunch of integer constants for the > bitfields, not an enum. Why? Because or-ing flags together creates a > value not in the enum… We nowadays typically declare the flags as enum, but when accepting the bitfield we use `unsigned`. Patrick