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

[PATCH 5/6] odb: drop `whence` field from object info

From
Patrick Steinhardt <ps@pks.im>
Date
Jun 24, 2026, 12:19 UTC
Message-ID
<20260624-b4-pks-odb-drop-whence-v1-5-8d1877b790ac@pks.im>
In-Reply-To
<20260624-b4-pks-odb-drop-whence-v1-0-8d1877b790ac@pks.im>

In the preceding commits we have migrated all callers to derive their information of how a specific object is stored to use the new object info source instead, and hence the field is now unused. Drop it.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 odb.c                 | 1 -
 odb.h                 | 7 -------
 odb/source-inmemory.c | 2 --
 odb/source-loose.c    | 2 --
 packfile.c            | 2 --
 5 files changed, 14 deletions(-)
diff --git a/odb.c b/odb.c
index 99f4e7551c..82c41f1793 100644
--- a/odb.c
+++ b/odb.c
@@ -691,7 +691,6 @@ static int oid_object_info_convert(struct repository *r,
 			return -1;
 		}
 	}
-	input_oi->whence = new_oi.whence;
 	if (input_oi->sourcep)
 		*input_oi->sourcep = *new_oi.sourcep;
 	return ret;
diff --git a/odb.h b/odb.h
index 330a55879e..e0d05eaf87 100644
--- a/odb.h
+++ b/odb.h
@@ -311,13 +311,6 @@ struct object_info {
 	 * or multiple times in the same source.
 	 */
 	struct object_info_source *sourcep;
-
-	/* Response */
-	enum {
-		OI_CACHED,
-		OI_LOOSE,
-		OI_PACKED,
-	} whence;
 };
 
 /*
diff --git a/odb/source-inmemory.c b/odb/source-inmemory.c
index 2328e62687..008e49bfe9 100644
--- a/odb/source-inmemory.c
+++ b/odb/source-inmemory.c
@@ -54,8 +54,6 @@ static void populate_object_info(struct odb_source_inmemory *source,
 		*oi->mtimep = 0;
 	if (oi->sourcep)
 		oi->sourcep->source = &source->base;
-
-	oi->whence = OI_CACHED;
 }
 
 static int odb_source_inmemory_read_object_info(struct odb_source *source,
diff --git a/odb/source-loose.c b/odb/source-loose.c
index 5c4e9892b5..e743ccab42 100644
--- a/odb/source-loose.c
+++ b/odb/source-loose.c
@@ -198,8 +198,6 @@ static int read_object_info_from_path(struct odb_source_loose *loose,
 			oidclr(oi->delta_base_oid, loose->base.odb->repo->hash_algo);
 		if (oi->sourcep && !ret)
 			oi->sourcep->source = &loose->base;
-		if (!ret)
-			oi->whence = OI_LOOSE;
 	}
 
 	return ret;
diff --git a/packfile.c b/packfile.c
index fa22095b75..4a8c108034 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1421,8 +1421,6 @@ int packed_object_info_with_index_pos(struct odb_source_packed *source,
 			oidclr(oi->delta_base_oid, p->repo->hash_algo);
 	}
 
-	oi->whence = OI_PACKED;
-
 	if (oi->sourcep) {
 		if (!source)
 			BUG("cannot request source without an owning source");
-- 
2.55.0.rc1.745.g43192e7977.dirty
Previous: Justin ToblerNext: Justin Tobler
Message 15 of 26 in “odb: refactor source-specific information in object info”
  1. 0/6 odb: refactor source-specific information in object infoPatrick Steinhardt, Jun 24, 2026
  2. 1/6 packfile: thread odb_source_packed through packed_object_info()Patrick Steinhardt, Jun 24, 2026
  3. Justin ToblerJun 29, 2026
  4. Patrick SteinhardtJun 30, 2026
  5. 2/6 odb: make backend-specific fields optionalPatrick Steinhardt, Jun 24, 2026
  6. Justin ToblerJun 29, 2026
  7. Patrick SteinhardtJun 30, 2026
  8. 3/6 odb: add `source` field to struct object_info_sourcePatrick Steinhardt, Jun 24, 2026
  9. Justin ToblerJun 29, 2026
  10. Junio C HamanoJun 29, 2026
  11. Patrick SteinhardtJun 30, 2026
  12. Junio C HamanoJun 30, 2026
  13. 4/6 treewide: convert users of `whence` to the new source fieldPatrick Steinhardt, Jun 24, 2026
  14. Justin ToblerJun 29, 2026
  15. 5/6 odb: drop `whence` field from object infoPatrick Steinhardt, Jun 24, 2026
  16. Justin ToblerJun 29, 2026
  17. 6/6 odb: document object info fieldsPatrick Steinhardt, Jun 24, 2026
  18. Junio C HamanoJun 24, 2026
  19. 0/6 odb: refactor source-specific information in object infoPatrick Steinhardt, Jul 2, 2026
  20. 1/6 packfile: thread odb_source_packed through packed_object_info()Patrick Steinhardt, Jul 2, 2026
  21. 2/6 odb: make backend-specific fields optionalPatrick Steinhardt, Jul 2, 2026
  22. 3/6 odb: add `source` field to struct object_info_sourcePatrick Steinhardt, Jul 2, 2026
  23. 4/6 treewide: convert users of `whence` to the new source fieldPatrick Steinhardt, Jul 2, 2026
  24. 5/6 odb: drop `whence` field from object infoPatrick Steinhardt, Jul 2, 2026
  25. 6/6 odb: document object info fieldsPatrick Steinhardt, Jul 2, 2026
  26. Junio C HamanoJul 5, 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.