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

[PATCH v2 0/5] Small fixups for `OBJECT_INFO` flags

From
Patrick Steinhardt <ps@pks.im>
Date
Feb 12, 2026, 06:59 UTC
Message-ID
<20260212-b4-pks-read-object-info-flags-v2-0-3bfa9bb149ef@pks.im>
In-Reply-To
<20260126-b4-pks-read-object-info-flags-v1-0-e682a003b17c@pks.im>
Hi,

I was kind of curious why there were gaps in the `OBJECT_INFO_*` flags, but eventually found out that these gaps are of historic nature: there used to be more flags, but their respective values got removed at one point in time. So naturally, I wanted to clean this up a bit so that the next reader wouldn't have the same question.

Surprisingly though I found out that this breaks tests, which of course puzzled me. As it turns out though, we were incorrectly using a couple of these flags for `odb_has_object()`, and the changed definitions had overlap with the existing meaning of other `HAS_OBJECT_*` flags. There isn't really any bug here as far as I can see, but this is only really by chance.

In any case, the first two commits fix calls to `odb_has_object()` that used invalid flags. The last commit then removes the gaps and converts the flags to use an enum instead.

Changes in v2:
  - Add two patches on top that convert the object info and
    `odb_has_object()` flags into enums.
  - Link to v1: https://lore.kernel.org/r/20260126-b4-pks-read-object-info-flags-v1-0-e682a003b17c@pks.im
Thanks!
Patrick
---
Patrick Steinhardt (5):
      builtin/backfill: fix flags passed to `odb_has_object()`
      builtin/fsck: fix flags passed to `odb_has_object()`
      odb: drop gaps in object info flag values
      odb: convert object info flags into an enum
      odb: convert `odb_has_object()` flags into an enum
 builtin/backfill.c |  3 +--
 builtin/fsck.c     |  3 ++-
 object-file.c      |  3 ++-
 object-file.h      |  3 ++-
 odb.c              |  4 ++--
 odb.h              | 44 +++++++++++++++++++++++++-------------------
 packfile.c         |  2 +-
 packfile.h         |  2 +-
 8 files changed, 36 insertions(+), 28 deletions(-)
Range-diff versus v1:

1: eec721a55b = 1: 308963f244 builtin/backfill: fix flags passed to `odb_has_object()` 2: 317893853b = 2: 7a69a648bb builtin/fsck: fix flags passed to `odb_has_object()` 3: c785043a72 < -: ---------- odb: drop gaps in object info flag values -: ---------- > 3: 0cea7f03f3 odb: drop gaps in object info flag values -: ---------- > 4: ab98547370 odb: convert object info flags into an enum -: ---------- > 5: 414dd30e14 odb: convert `odb_has_object()` flags into an enum

--- base-commit: ea24e2c55433012a0a6c4ae947a87bc66404e484 change-id: 20260126-b4-pks-read-object-info-flags-236c4437cfc5

Previous: Junio C HamanoNext: Patrick Steinhardt
Message 18 of 23 in “Small fixups for `OBJECT_INFO` flags”
  1. 0/3 Small fixups for `OBJECT_INFO` flagsPatrick Steinhardt, Jan 26, 2026
  2. 1/3 builtin/backfill: fix flags passed to `odb_has_object()`Patrick Steinhardt, Jan 26, 2026
  3. Derrick StoleeJan 26, 2026
  4. Junio C HamanoJan 26, 2026
  5. Justin ToblerFeb 9, 2026
  6. Karthik NayakFeb 10, 2026
  7. Karthik NayakFeb 10, 2026
  8. 2/3 builtin/fsck: fix flags passed to `odb_has_object()`Patrick Steinhardt, Jan 26, 2026
  9. Justin ToblerFeb 9, 2026
  10. 3/3 odb: drop gaps in object info flag valuesPatrick Steinhardt, Jan 26, 2026
  11. Junio C HamanoJan 26, 2026
  12. René ScharfeJan 26, 2026
  13. Junio C HamanoJan 26, 2026
  14. Patrick SteinhardtJan 27, 2026
  15. Justin ToblerFeb 9, 2026
  16. Justin ToblerFeb 9, 2026
  17. Junio C HamanoJan 26, 2026
  18. 0/5 Small fixups for `OBJECT_INFO` flagsPatrick Steinhardt, Feb 12, 2026
  19. 1/5 builtin/backfill: fix flags passed to `odb_has_object()`Patrick Steinhardt, Feb 12, 2026
  20. 2/5 builtin/fsck: fix flags passed to `odb_has_object()`Patrick Steinhardt, Feb 12, 2026
  21. 3/5 odb: drop gaps in object info flag valuesPatrick Steinhardt, Feb 12, 2026
  22. 4/5 odb: convert object info flags into an enumPatrick Steinhardt, Feb 12, 2026
  23. 5/5 odb: convert `odb_has_object()` flags into an enumPatrick Steinhardt, Feb 12, 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.