Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 02/11] Factor out and export large blob writing code to arbitrary file handle

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:09

Nguyễn Thái Ngọc Duy  [off-list ref] writes:
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
 cache.h |    3 +++
 entry.c |   39 ++++++++++++++++++++++++++-------------
 2 files changed, 29 insertions(+), 13 deletions(-)
It was the goal of the original streaming output topic to helping more
callers stream the data out directly from the object store in order to
reduce memory pressure, and this series is very much in line with its
spirit.

The static version of streaming_write_entry() in entry.c was very specific
to writing out an index entry out to the working tree, and it made perfect
sense to have the function in that file, but its interface was limited to
the original context the function was used in.

The whole point of your refactoring in this patch is to make it available
for callers outside that original context; e.g. archive that finds blob
SHA-1 from a tree and writes the blob out to its standard output.  They
should not have to work with an API that takes a cache-entry and writes to
a working tree file.  And your result is much more generic.

So I think the external declaration and the definition should move to a
more generic place, namely streaming.[ch].  It does not belong to entry.c
anymore.

Thanks for working on this.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help