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

2016-08-10 Thread Johannes Sixt
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

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

2016-08-09 Thread Stefan Beller
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/

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

2016-08-09 Thread Stefan Beller
On Tue, Aug 9, 2016 at 3:56 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? > >

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

2016-08-09 Thread 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: >> From: Jacob Keller >> >> For projects which have frequent updates to submodules it is often >> useful to be able to

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

2016-08-09 Thread Stefan Beller
On Tue, Aug 9, 2016 at 3:32 PM, Jacob Keller wrote: > From: Jacob Keller > > For projects which have frequent updates to submodules it is often > useful to be able to see a submodule update commit as a difference. > Teach diff's --submodule= a

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

2016-08-09 Thread Junio C Hamano
Jacob Keller writes: > +static int prepare_submodule_diff(struct strbuf *buf, const char *path, > + unsigned char one[20], unsigned char two[20]) > +{ > + struct child_process cp = CHILD_PROCESS_INIT; > + cp.git_cmd = 1; > + cp.dir = path; > +

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

2016-08-09 Thread Jacob Keller
From: Jacob Keller For projects which have frequent updates to submodules it is often useful to be able to see a submodule update commit as a difference. Teach diff's --submodule= a new "diff" format which will execute a diff for the submodule between the old and new