On Tue, Aug 9, 2016 at 3:56 PM, Jacob Keller <jacob.kel...@gmail.com> 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?

Maybe, roughly:

    cp.stdout = -1;
    do {
        int r = xread(cp.stdout, buf, MAX_IO_SIZE);
    } while (r >=0);

xread does use a poll() for you so it is not active polling,
but only reading when data is available.

>> When not checked out, we can invoke the diff command
>> in .git/modules/<name> as that is the git dir of the submodule,
>> i.e. operating diff with a bare repo?
> We can actually do this every time. How would you pass that in a
> child_process? I don't think it's "dir" but instead passing
> "--git-dir" somehow?

git -C $GIT_DIR diff --relative ${superprojects ce->name}

with $GIT_DIR = ${SUPERPROJECTS GITDIR + modules/<name>/ with name to be looked
as submodule_from_path(ce->name) and then taking `name` from the
submodule struct)

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to