git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] Improvements for reading object info
@ 2025-12-18  6:28 Patrick Steinhardt
  2025-12-18  6:28 ` [PATCH 1/8] object-file: always set OI_LOOSE when " Patrick Steinhardt
                   ` (9 more replies)
  0 siblings, 10 replies; 23+ messages in thread
From: Patrick Steinhardt @ 2025-12-18  6:28 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Aaron Plattner

Hi,

this patch series contains various small improvements for reading object
info for either loose or packed objects. These improvements were split
out of a larger patch series where I'm about to introduce a new generic
`odb_for_each_object()` function.

This series has a conflict with ps/packfile-store-in-odb-source. I
decided to not make this a dependency though because those two topics
are independent from one another, and I expect that this series here
will be merged down faster than the conflicting one. Furthermore, the
conflict itself is quite minor:

diff --cc packfile.c
index 8daa5a5ee7,ce6716fbea..0000000000
--- a/packfile.c
+++ b/packfile.c
@@@ -2157,10 -2132,11 +2151,10 @@@ int packfile_store_read_object_info(str
  				    struct object_info *oi,
  				    unsigned flags UNUSED)
  {
 -	static struct object_info blank_oi = OBJECT_INFO_INIT;
  	struct pack_entry e;
 -	int rtype;
 +	int ret;
  
- 	if (!find_pack_entry(store->odb->repo, oid, &e))
+ 	if (!find_pack_entry(store, oid, &e))
  		return 1;
  
  	/*
@@@ -2549,9 -2555,8 +2571,9 @@@ int packfile_store_read_object_stream(s
  	oi.sizep = &size;
  
  	if (packfile_store_read_object_info(store, oid, &oi, 0) ||
 -	    oi.u.packed.is_delta ||
 +	    oi.u.packed.type == PACKED_OBJECT_TYPE_REF_DELTA ||
 +	    oi.u.packed.type == PACKED_OBJECT_TYPE_OFS_DELTA ||
- 	    repo_settings_get_big_file_threshold(store->odb->repo) >= size)
+ 	    repo_settings_get_big_file_threshold(store->source->odb->repo) >= size)
  		return -1;
  
  	in_pack_type = unpack_object_header(oi.u.packed.pack,

I'd thus propose to merge this series via an evil merge, but if this
proves to be burdensome I'm happy to defer it to a later point. Just let
me know and I'll adapt accordingly, thanks!

This also fixes the issue reported in <f4ba7e89-4717-4b36-921f-56537131fd69@nvidia.com>.

Patrick

---
Patrick Steinhardt (8):
      object-file: always set OI_LOOSE when reading object info
      packfile: always declare object info to be OI_PACKED
      packfile: extend `is_delta` field to allow for "unknown" state
      packfile: always populate pack-specific info when reading object info
      packfile: disentangle return value of `packed_object_info()`
      packfile: skip unpacking object header for disk size requests
      packfile: fix short-circuiting of empty requests
      packfile: drop repository parameter from `packed_object_info()`

 builtin/cat-file.c     |  3 +--
 builtin/pack-objects.c |  4 +--
 commit-graph.c         |  2 +-
 object-file.c          | 13 ++++++++--
 odb.h                  | 18 +++++++++++--
 pack-bitmap.c          |  3 +--
 packfile.c             | 69 +++++++++++++++++++++++++++++++-------------------
 packfile.h             |  7 +++--
 8 files changed, 80 insertions(+), 39 deletions(-)


---
base-commit: c4a0c8845e2426375ad257b6c221a3a7d92ecfda
change-id: 20251215-b4-pks-odb-read-object-info-improvements-0e031ef827d2


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2025-12-30 17:03 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18  6:28 [PATCH 0/8] Improvements for reading object info Patrick Steinhardt
2025-12-18  6:28 ` [PATCH 1/8] object-file: always set OI_LOOSE when " Patrick Steinhardt
2025-12-18  6:28 ` [PATCH 2/8] packfile: always declare object info to be OI_PACKED Patrick Steinhardt
2025-12-18  7:23   ` Junio C Hamano
2025-12-18  9:10     ` Patrick Steinhardt
2025-12-18  6:28 ` [PATCH 3/8] packfile: extend `is_delta` field to allow for "unknown" state Patrick Steinhardt
2025-12-18  6:28 ` [PATCH 4/8] packfile: always populate pack-specific info when reading object info Patrick Steinhardt
2025-12-18  7:32   ` Junio C Hamano
2025-12-18  6:28 ` [PATCH 5/8] packfile: disentangle return value of `packed_object_info()` Patrick Steinhardt
2025-12-18  6:28 ` [PATCH 6/8] packfile: skip unpacking object header for disk size requests Patrick Steinhardt
2025-12-18  6:28 ` [PATCH 7/8] packfile: fix short-circuiting of empty requests Patrick Steinhardt
2025-12-18  6:28 ` [PATCH 8/8] packfile: drop repository parameter from `packed_object_info()` Patrick Steinhardt
2025-12-18  8:09 ` [PATCH 0/8] Improvements for reading object info Junio C Hamano
2025-12-18  8:30   ` Patrick Steinhardt
2025-12-18 10:54 ` [PATCH v2 0/7] " Patrick Steinhardt
2025-12-18 10:54   ` [PATCH v2 1/7] object-file: always set OI_LOOSE when " Patrick Steinhardt
2025-12-18 10:54   ` [PATCH v2 2/7] packfile: always declare object info to be OI_PACKED Patrick Steinhardt
2025-12-18 10:54   ` [PATCH v2 3/7] packfile: extend `is_delta` field to allow for "unknown" state Patrick Steinhardt
2025-12-18 10:54   ` [PATCH v2 4/7] packfile: always populate pack-specific info when reading object info Patrick Steinhardt
2025-12-30 17:03     ` Kristoffer Haugsbakk
2025-12-18 10:54   ` [PATCH v2 5/7] packfile: disentangle return value of `packed_object_info()` Patrick Steinhardt
2025-12-18 10:54   ` [PATCH v2 6/7] packfile: skip unpacking object header for disk size requests Patrick Steinhardt
2025-12-18 10:54   ` [PATCH v2 7/7] packfile: drop repository parameter from `packed_object_info()` Patrick Steinhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).