Am 10.08.2016 um 00:56 schrieb Jacob Keller:
On Tue, Aug 9, 2016 at 3:50 PM, Stefan Beller <> wrote:
On Tue, Aug 9, 2016 at 3:32 PM, Jacob Keller <> wrote:
+       if (strbuf_read(buf, cp.out, 0) < 0)

So we keep the whole diff in memory
I don't know much about the diff machinery, but I thought
the rest of the diff machinery just streams it out?

Yea, but I can't figure out how to do that. Is there an easy way to
stream chunks from the pipe straight into the file?

You don't stream via a pipe, you let the sub-process write directly to the file:

        cp.out = dup(fileno(f));

Of course, you no longer "prepare_submodule_diff" anymore (which currently runs the child process), but you print the "Submodule" header line, then invoke the child process, and if there was a failure, you fprintf(f, "(diff failed)").

-- Hannes

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to