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

Re: [PATCH v2] refs.h: make all flags arguments unsigned

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 3, 2022, 18:27 UTC
Message-ID
<xmqqo83nvm8w.fsf@gitster.g>
In-Reply-To
<220203.8635kz6d2o.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> Yes, enums or not, what I was also pointing out in
> https://lore.kernel.org/git/220201.86ilty9vq2.gmgdl@evledraar.gmail.com/
> is that changing just one logical set of flags at a time would make this
> much easier to review.

Another thing to consider is how to make this play better with other topics in flight. Basing a huge single patch on top of 'seen' is a way to ensure that the patch will never be useful. There won't be a good time when such a topic can graduate. The topic will also have a hard time keeping up with what new topics add while waiting for what happen to be in 'seen' today (some of which may even go away without graduating) all graduate.

Limiting the scope to small and more stable subset of flags that are in 'master' and does not conflict (e.g. no new bit defined to the set of flags, no existing bit gets removed, no new callers that use the bitset introduced) with other topics would incrementally improve the code base, and makes progress in the sense that it reduces the remaining work.

> It doesn't matter for the end result as long as we end up with "unsigned
> int" everywhere, but would with enums.

As it won't be an error to assign to what has converted to enum a value that is in int or unsigned that comes from the part of the code base that is not yet converted, so it may be OK either way.

Assigning between converted "unsigned" and unconverted "int" may add unnecessary warnings during transitory period, but I think the story would be the same for a flag bitset that is conveted into an "enum", which the compiler happens to make it "unsigned", which was originally a signed "int".

Thanks.
Previous: Ævar Arnfjörð BjarmasonNext: Han-Wen Nienhuys
Message 12 of 17 in “refs.h: make all flags arguments unsigned”
  1. refs.h: make all flags arguments unsignedHan-Wen Nienhuys via GitGitGadget, Jan 31, 2022
  2. Junio C HamanoFeb 1, 2022
  3. Han-Wen NienhuysFeb 1, 2022
  4. Junio C HamanoFeb 1, 2022
  5. refs.h: make all flags arguments unsignedHan-Wen Nienhuys via GitGitGadget, Feb 1, 2022
  6. Ævar Arnfjörð BjarmasonFeb 1, 2022
  7. Junio C HamanoFeb 1, 2022
  8. Han-Wen NienhuysFeb 3, 2022
  9. Ævar Arnfjörð BjarmasonFeb 3, 2022
  10. Han-Wen NienhuysFeb 3, 2022
  11. Ævar Arnfjörð BjarmasonFeb 3, 2022
  12. Junio C HamanoFeb 3, 2022
  13. Han-Wen NienhuysFeb 3, 2022
  14. Junio C HamanoFeb 3, 2022
  15. 0/2 refs.h: make all flags arguments unsignedHan-Wen Nienhuys via GitGitGadget, Feb 3, 2022
  16. 1/2 refs.h: make all flags arguments unsignedHan-Wen Nienhuys via GitGitGadget, Feb 3, 2022
  17. 2/2 Uniformize flag argument naming to `flags` or `unused_flags`Han-Wen Nienhuys via GitGitGadget, Feb 3, 2022

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.