<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/streaming.c, branch main</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2025-11-23T20:56:46Z</updated>
<entry>
<title>streaming: move into object database subsystem</title>
<updated>2025-11-23T20:56:46Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-11-23T18:59:43Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=1599b68d5e960a12f5ac624f81c70ece317db5a6'/>
<id>urn:sha1:1599b68d5e960a12f5ac624f81c70ece317db5a6</id>
<content type='text'>
The "streaming" terminology is somewhat generic, so it may not be
immediately obvious that "streaming.{c,h}" is specific to the object
database. Rectify this by moving it into the "odb/" directory so that it
can be immediately attributed to the object subsystem.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>streaming: refactor interface to be object-database-centric</title>
<updated>2025-11-23T20:56:45Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-11-23T18:59:42Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=378ec56beba161abbef6e2c87d9bc2ac43c355f3'/>
<id>urn:sha1:378ec56beba161abbef6e2c87d9bc2ac43c355f3</id>
<content type='text'>
Refactor the streaming interface to be centered around object databases
instead of centered around the repository. Rename the functions
accordingly.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>streaming: move logic to read packed objects streams into backend</title>
<updated>2025-11-23T20:56:45Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-11-23T18:59:41Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=8c1b84bc977bf1e4515efe0386de87257ec28689'/>
<id>urn:sha1:8c1b84bc977bf1e4515efe0386de87257ec28689</id>
<content type='text'>
Move the logic to read packed object streams into the respective
subsystem.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>streaming: move logic to read loose objects streams into backend</title>
<updated>2025-11-23T20:56:45Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-11-23T18:59:40Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=bc30a2f5dff6dd39966819ca3771ab5e9e072123'/>
<id>urn:sha1:bc30a2f5dff6dd39966819ca3771ab5e9e072123</id>
<content type='text'>
Move the logic to read loose object streams into the respective
subsystem. This allows us to make a couple of function declarations
private.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>streaming: make the `odb_read_stream` definition public</title>
<updated>2025-11-23T20:56:45Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-11-23T18:59:39Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=ffc9a3448500caa50766876ef2169e0f26ad3b3c'/>
<id>urn:sha1:ffc9a3448500caa50766876ef2169e0f26ad3b3c</id>
<content type='text'>
Subsequent commits will move the backend-specific logic of setting up an
object read stream into the specific subsystems. As the backends are now
the ones that are responsible for allocating the stream they'll need to
have the stream definition available to them.

Make the stream definition public to prepare for this.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>streaming: get rid of `the_repository`</title>
<updated>2025-11-23T20:56:45Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-11-23T18:59:38Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c26da3446e98ad4aa98ec9154c70c6fd35cb9ad6'/>
<id>urn:sha1:c26da3446e98ad4aa98ec9154c70c6fd35cb9ad6</id>
<content type='text'>
Subsequent commits will move the backend-specific logic of object
streaming into their respective subsystems. These subsystems have gotten
rid of `the_repository` already, but we still use it in two locations in
the streaming subsystem.

Prepare for the move by fixing those two cases. Converting the logic in
`open_istream_pack_non_delta()` is trivial as we already got the object
database as input.

But for `stream_blob_to_fd()` we have to add a new parameter to make it
accessible. So, as we already have to adjust all callers anyway, rename
the function to `odb_stream_blob_to_fd()` to indicate it's part of the
object subsystem.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>streaming: rely on object sources to create object stream</title>
<updated>2025-11-23T20:56:45Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-11-23T18:59:37Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=4c89d31494bff4bde6079a0e0821f1437e37d07b'/>
<id>urn:sha1:4c89d31494bff4bde6079a0e0821f1437e37d07b</id>
<content type='text'>
When creating an object stream we first look up the object info and, if
it's present, we call into the respective backend that contains the
object to create a new stream for it.

This has the consequence that, for loose object source, we basically
iterate through the object sources twice: we first discover that the
file exists as a loose object in the first place by iterating through
all sources. And, once we have discovered it, we again walk through all
sources to try and map the object. The same issue will eventually also
surface once the packfile store becomes per-object-source.

Furthermore, it feels rather pointless to first look up the object only
to then try and read it.

Refactor the logic to be centered around sources instead. Instead of
first reading the object, we immediately ask the source to create the
object stream for us. If the object exists we get stream, otherwise
we'll try the next source.

Like this we only have to iterate through sources once. But even more
importantly, this change also helps us to make the whole logic
pluggable. The object read stream subsystem does not need to be aware of
the different source backends anymore, but eventually it'll only have to
call the source's callback function.

Note that at the current point in time we aren't fully there yet:

  - The packfile store still sits on the object database level and is
    thus agnostic of the sources.

  - We still have to call into both the packfile store and the loose
    object source.

But both of these issues will soon be addressed.

This refactoring results in a slight change to semantics: previously, it
was `odb_read_object_info_extended()` that picked the source for us, and
it would have favored packed (non-deltified) objects over loose objects.
And while we still favor packed over loose objects for a single source
with the new logic, we'll now favor a loose object from an earlier
source over a packed object from a later source.

Ultimately this shouldn't matter though: the stream doesn't indicate to
the caller which source it is from and whether it was created from a
packed or loose object, so such details are opaque to the caller. And
other than that we should be able to assume that two objects with the
same object ID should refer to the same content, so the streamed data
would be the same, too.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>streaming: move zlib stream into backends</title>
<updated>2025-11-23T20:56:45Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-11-23T18:59:35Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=eb5abbb4e6a8c06f5c6275bbb541bf7d736171c5'/>
<id>urn:sha1:eb5abbb4e6a8c06f5c6275bbb541bf7d736171c5</id>
<content type='text'>
While all backend-specific data is now contained in a backend-specific
structure, we still share the zlib stream across the loose and packed
objects.

Refactor the code and move it into the specific structures so that we
fully detangle the different backends from one another.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>streaming: create structure for filtered object streams</title>
<updated>2025-11-23T20:56:45Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-11-23T18:59:34Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=1154b2d2e511113e9b7d567788b72acb05713915'/>
<id>urn:sha1:1154b2d2e511113e9b7d567788b72acb05713915</id>
<content type='text'>
As explained in a preceding commit, we want to get rid of the union of
stream-type specific data in `struct odb_read_stream`. Create a new
structure for filtered object streams to move towards this design.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>streaming: create structure for packed object streams</title>
<updated>2025-11-23T20:56:45Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-11-23T18:59:33Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=5f0d8d2e8d3f992f58af247b6d21509c3c7595ca'/>
<id>urn:sha1:5f0d8d2e8d3f992f58af247b6d21509c3c7595ca</id>
<content type='text'>
As explained in a preceding commit, we want to get rid of the union of
stream-type specific data in `struct odb_read_stream`. Create a new
structure for packed object streams to move towards this design.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
