Re: [PATCH v2 1/6] object-file: refactor write_loose_object() to support inputstream
From: Junio C Hamano <hidden>
Date: 2021-11-18 06:45:25
Jiang Xin [off-list ref] writes:
On Fri, Nov 12, 2021 at 5:43 PM Han Xin [off-list ref] wrote:quoted
From: Han Xin <redacted>It would be better to provide a cover letter describing changes in v2, such as: * Make "write_loose_object()" a public method, so we can reuse it in "unpack_non_delta_entry()". (But I doubt we can use "write_object_file_flags()" public function, without make this change.) * Add an new interface "input_stream" as an argument for "write_loose_object()", so that we can feed data to "write_loose_object()" from buffer or from zlib stream.quoted
Refactor write_loose_object() to support inputstream, in the same way that zlib reading is chunked.In the beginning of your commit log, you should describe the problem, such as: We used to read the full content of a blob into buffer in "unpack_non_delta_entry()" by calling: void *buf = get_data(size); This will consume lots of memory for a very big blob object.
I was not sure where "in_stream" came from---"use X insteads of Y", when X is what these patches invent and introduce, does not make a good explanation without explaining what X is, what problem X is attempting to solve and how. Thanks for helping to clarify the proposed log message.