Re: [PATCH v2 3/4] diff: add long-running diff process via diff.<driver>.process
- From
Michael Montalbo <mmontalbo@gmail.com>
- Date
- May 29, 2026, 00:55 UTC
- Message-ID
- <CAC2QwmLa24iaUz5G0rnt-kxE5_o+4WdS2eYA_JyC_GfPhLUW6g@mail.gmail.com>
- In-Reply-To
- <xmqqjysqnbxu.fsf@gitster.g>
On Mon, May 25, 2026 at 7:26 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 57 quoted lines
> > "Michael Montalbo via GitGitGadget" <gitgitgadget@gmail.com> writes: > > > Zero hunks with status=success means the tool considers the > > files equivalent. Git skips diff output for that file. > > Is "zero hunk" a common word or some random string you invented? If > the latter, which is I am assuming it to be, you should define what > it means at/before the first use. Here in the proposed log message, > and ... > > > > > Signed-off-by: Michael Montalbo <mmontalbo@gmail.com> > > --- > > Documentation/config/diff.adoc | 8 + > > Documentation/gitattributes.adoc | 40 ++++ > > Makefile | 1 + > > diff-process.c | 206 +++++++++++++++++++ > > diff-process.h | 28 +++ > > diff.c | 23 +++ > > t/.gitattributes | 1 + > > t/t4080-diff-process.sh | 338 +++++++++++++++++++++++++++++++ > > 8 files changed, 645 insertions(+) > > create mode 100644 diff-process.c > > create mode 100644 diff-process.h > > create mode 100755 t/t4080-diff-process.sh > > > > diff --git a/Documentation/config/diff.adoc b/Documentation/config/diff.adoc > > index 1135a62a0a..4ab5f60df6 100644 > > --- a/Documentation/config/diff.adoc > > +++ b/Documentation/config/diff.adoc > > @@ -218,6 +218,14 @@ endif::git-diff[] > > Set this option to `true` to make the diff driver cache the text > > conversion outputs. See linkgit:gitattributes[5] for details. > > > > +`diff.<driver>.process`:: > > + The command to run as a long-running diff process. > > + The tool communicates via the pkt-line protocol and returns > > + hunks that are fed into Git's diff and blame pipelines. > > + If the tool returns zero hunks, the file is treated as > > + unchanged for both diff output and blame attribution. > > + See linkgit:gitattributes[5] for details. > > ... also here. > > I do not know if you mean "the tool returns no hunks" (there is no > "hunk <old_start> <old_count> <new_start> <new_count>" line passed > from the tool over the protocol) or "the tool returns zero-hunk" > (there is a special "zero-hunk" message to signal this particular > condition sent over the protocol), and this description does not > quite help disambiguating between the two. > > If the former, then avoid "zero hunks" as it sounds like a noun with > special meaning. Yes, we can say "tool returns one hunk", "tool > returns 31 hunks", etc., so "tool returns zero hunks" may logically > be correct, but "when the tool returns no hunks with status=success" > is much less confusing, I think.
Yes, "zero hunks" was my own invention and I see why it's confusing. Will update the messaging to use "no hunks" instead and do a broader sweep of the documentation to clarify the protocol and expected tool behavior.