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

[PATCH 1/2] object-store: introduce OBJECT_INFO_NO_FETCH_IF_MISSING

From
Christian Couder <christian.couder@gmail.com>
Date
Jun 20, 2019, 08:30 UTC
Message-ID
<20190620083026.14524-2-chriscool@tuxfamily.org>
In-Reply-To
<20190620083026.14524-1-chriscool@tuxfamily.org>

The fetch_if_missing global variable should be replaced as much as possible by passing a flag to oid_object_info_extended().

The existing OBJECT_INFO_FOR_PREFETCH unfortunately conflates both a "no fetch if missing" meaning with OBJECT_INFO_QUICK which is about retrying packed storage.

Let's disambiguate that by adding a new explicit OBJECT_INFO_NO_FETCH_IF_MISSING flag.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 object-store.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/object-store.h b/object-store.h
index 272e01e452..02c1795d50 100644
--- a/object-store.h
+++ b/object-store.h
@@ -277,10 +277,15 @@ struct object_info {
 #define OBJECT_INFO_IGNORE_LOOSE 16
 /*
  * Do not attempt to fetch the object if missing (even if fetch_is_missing is
- * nonzero). This is meant for bulk prefetching of missing blobs in a partial
+ * nonzero).
+ */
+#define OBJECT_INFO_NO_FETCH_IF_MISSING 32
+/*
+ * This is meant for bulk prefetching of missing blobs in a partial
  * clone. Implies OBJECT_INFO_QUICK.
  */
-#define OBJECT_INFO_FOR_PREFETCH (32 + OBJECT_INFO_QUICK)
+#define OBJECT_INFO_FOR_PREFETCH \
+  (OBJECT_INFO_NO_FETCH_IF_MISSING + OBJECT_INFO_QUICK)
 
 int oid_object_info_extended(struct repository *r,
 			     const struct object_id *,
-- 
2.22.0
Previous: Christian CouderNext: Jeff King
Message 2 of 10 in “Add OBJECT_INFO_NO_FETCH_IF_MISSING flag”
  1. 0/2 Add OBJECT_INFO_NO_FETCH_IF_MISSING flagChristian Couder, Jun 20, 2019
  2. 1/2 object-store: introduce OBJECT_INFO_NO_FETCH_IF_MISSINGChristian Couder, Jun 20, 2019
  3. Jeff KingJun 20, 2019
  4. 2/2 sha1-file: use OBJECT_INFO_NO_FETCH_IF_MISSINGChristian Couder, Jun 20, 2019
  5. Jeff KingJun 20, 2019
  6. Derrick StoleeJun 20, 2019
  7. Christian CouderJun 20, 2019
  8. Junio C HamanoJun 20, 2019
  9. Junio C HamanoJun 20, 2019
  10. Christian CouderJun 21, 2019

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.