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

2016-08-10 Thread Junio C Hamano
Jacob Keller writes: >>> + diff = fdopen(cp.out, "r"); >>> + >>> + c = fgetc(diff); >>> + while (c != EOF) { >>> + fputc(c, f); >>> + c = fgetc(diff); >>> + } >>> + >>> + fclose(diff); >>> + finish_command(); >> >> I do not

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

2016-08-10 Thread Jacob Keller
On Tue, Aug 9, 2016 at 5:53 PM, Stefan Beller wrote: > This is not used any more, but the child is run directly below? > unsigned char one[20], unsigned char two[20]) >> +{ > Yea I meant to take it all out and forgot. Will be gone in v3. > > This pattern seems

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

2016-08-10 Thread Jacob Keller
On Tue, Aug 9, 2016 at 8:37 PM, Junio C Hamano wrote: > Jacob Keller writes: >> + cp.dir = path; >> + cp.out = -1; >> + cp.no_stdin = 1; >> + argv_array_push(, "diff"); >> + argv_array_pushf(, "--src-prefix=a/%s/", path);

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

2016-08-09 Thread Junio C Hamano
Jacob Keller writes: > +void show_submodule_diff(FILE *f, const char *path, > + const char *line_prefix, > + unsigned char one[20], unsigned char two[20], > + unsigned dirty_submodule, const char *meta, > + const char

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

2016-08-09 Thread Stefan Beller
On Tue, Aug 9, 2016 at 5:23 PM, Jacob Keller wrote: > > +static int prepare_submodule_diff(struct strbuf *buf, const char *path, > + unsigned char one[20], unsigned char two[20]) > +{ This is not used any more, but the child is run directly below? > +

[PATCH RFC v2] 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