Re: [PATCH RFC] diff: add SUBMODULE_DIFF format to display submodule diff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 10.08.2016 um 00:56 schrieb Jacob Keller:
On Tue, Aug 9, 2016 at 3:50 PM, Stefan Beller <sbeller@xxxxxxxxxx> wrote:
On Tue, Aug 9, 2016 at 3:32 PM, Jacob Keller <jacob.e.keller@xxxxxxxxx> 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:

	fflush(f);
	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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]