Re: [PATCH v2 17/19] streaming: refactor interface to be object-database-centric
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 22, 2025, 00:10 UTC
- Message-ID
- <xmqqv7j32ahh.fsf@gitster.g>
- In-Reply-To
- <20251121-b4-pks-odb-read-stream-v2-17-ca8534963150@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
> Refactor the streaming interface to be centered around object databases > instead of centered around the repository. Rename the functions > accordingly.
Good idea.
> - st = open_istream(r, oid, &type, &sz, NULL); > + st = odb_read_object_stream(r->objects, oid, &type, &sz, NULL);
Calling the thing that is returned a "read stream" is a lot more trivially obvious than the original name "i(nput) stream", and I like that aspect of the new name a lot better, and the structure is also named appropriately ("struct odb_read_stream").
At least the old naming was consistent with the usual file I/O API. you "open" istream, then "read" from that istream, and finally "close" that istream. If you insist on having the noun first before the verb, call them
odb_read_stream_open()
odb_read_stream_read()
odb_read_stream_close()perhaps? I think _read and _close are already named appropriately.