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

[PATCH v2 3/5] odb: drop gaps in object info flag values

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

The object info flag values have a two gaps in their definitions, where some bits are skipped over. These gaps don't really hurt, but it makes one wonder whether anything is going on and whether a subset of flags might be defined somewhere else.

That's not the case though. Instead, this is a case of flags that have been dropped in the past:

  - The value 4 was used by `OBJECT_INFO_SKIP_CACHED`, removed in
    9c8a294a1a (sha1-file: remove OBJECT_INFO_SKIP_CACHED, 2020-01-02).
  - The value 8 was used by `OBJECT_INFO_ALLOW_UNKNOWN_TYPE`, removed in
    ae24b032a0 (object-file: drop OBJECT_INFO_ALLOW_UNKNOWN_TYPE flag,
    2025-05-16).
Close those gaps to avoid any more confusion.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 odb.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/odb.h b/odb.h
index bab07755f4..8e1fca7755 100644
--- a/odb.h
+++ b/odb.h
@@ -353,14 +353,14 @@ struct object_info {
 #define OBJECT_INFO_INIT { 0 }
 
 /* Invoke lookup_replace_object() on the given hash */
-#define OBJECT_INFO_LOOKUP_REPLACE 1
+#define OBJECT_INFO_LOOKUP_REPLACE (1 << 0)
 /* Do not retry packed storage after checking packed and loose storage */
-#define OBJECT_INFO_QUICK 8
+#define OBJECT_INFO_QUICK (1 << 1)
 /*
  * Do not attempt to fetch the object if missing (even if fetch_is_missing is
  * nonzero).
  */
-#define OBJECT_INFO_SKIP_FETCH_OBJECT 16
+#define OBJECT_INFO_SKIP_FETCH_OBJECT (1 << 2)
 /*
  * This is meant for bulk prefetching of missing blobs in a partial
  * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK
@@ -368,7 +368,7 @@ struct object_info {
 #define OBJECT_INFO_FOR_PREFETCH (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK)
 
 /* Die if object corruption (not just an object being missing) was detected. */
-#define OBJECT_INFO_DIE_IF_CORRUPT 32
+#define OBJECT_INFO_DIE_IF_CORRUPT (1 << 3)
 
 /*
  * Read object info from the object database and populate the `object_info`
-- 
2.53.0.295.g64333814d3.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 21 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.