From: Stefan Beller Date: Tue, 09 Aug 2016 23:15:27 GMT Subject: Re: [PATCH RFC] diff: add SUBMODULE_DIFF format to display submodule diff Message-ID: In-Reply-To: On Tue, Aug 9, 2016 at 4:10 PM, Stefan Beller wrote: > xread does use a poll() for you so it is not active polling, > but only reading when data is available. s/active polling/ spinning/ > > >>> >>> When not checked out, we can invoke the diff command >>> in .git/modules/ 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? I think it doesn't matter. You can still use .dir. (That would be equivalent to `cd $GIT_DIR && git diff sha1..sha1` which works just as well, even in the submodule case) Alternatively you could do argv_array_pushf(cp.env_array, "GIT_DIR=%s", ...) So I would drop the -C here and just use the .dir attribute. > git -C $GIT_DIR diff --relative ${superprojects ce->name}