git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] add--interactive: detect bogus diffFilter output

From
Jeff King <peff@peff.net>
Date
Mar 5, 2018, 20:56 UTC
Message-ID
<20180305205626.GD5953@sigill.intra.peff.net>
In-Reply-To
<xmqqsh9e8css.fsf@gitster-ct.c.googlers.com>
On Mon, Mar 05, 2018 at 12:53:07PM -0800, Junio C Hamano wrote:
Show 17 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > It's important that the diff-filter only filter the
> > individual lines, and that there remain a one-to-one mapping
> > between the input and output lines. Otherwise, things like
> > hunk-splitting will behave quite unexpectedly (e.g., you
> > think you are splitting at one point, but it has a different
> > effect in the text patch we apply).
> >
> > We can't detect all problematic cases, but we can at least
> > catch the obvious case where we don't even have the correct
> > number of lines.
> 
> Will queue.  We could probably also make sure that each of the
> corresponding line pair begins with the same '-/ /+' letter, but we
> need to draw a line and stop somewhere, and I think the number of
> lines is probably a good enough place.

I think that would break things like diff-so-fancy, which actually removes the -/+ in favor of pure coloring (not something I care for myself, but it seems a legitimate use case). So it's probably best not to look at the content, not just from a "we can only go so far" perspective but also because we actively don't know what the filter's output is supposed to look like.

-Peff
Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 11 of 23 in “Bug report: "Use of uninitialized value $_ in print"”
  1. Sam KuperMar 2, 2018
  2. Jonathan NiederMar 2, 2018
  3. Jeff KingMar 2, 2018
  4. Junio C HamanoMar 2, 2018
  5. Jeff KingMar 2, 2018
  6. Junio C HamanoMar 2, 2018
  7. Jeff KingMar 3, 2018
  8. 1/2 t3701: add a test for interactive.diffFilterJeff King, Mar 3, 2018
  9. 2/2 add--interactive: detect bogus diffFilter outputJeff King, Mar 3, 2018
  10. Junio C HamanoMar 5, 2018
  11. Jeff KingMar 5, 2018
  12. Ævar Arnfjörð BjarmasonMar 5, 2018
  13. Junio C HamanoMar 5, 2018
  14. Ævar Arnfjörð BjarmasonMar 5, 2018
  15. Jonathan NiederMar 5, 2018
  16. Sam KuperMar 2, 2018
  17. Jeff KingMar 2, 2018
  18. Sam KuperMar 2, 2018
  19. Jeff KingMar 3, 2018
  20. Junio C HamanoMar 2, 2018
  21. Sam KuperMar 2, 2018
  22. Junio C HamanoMar 2, 2018
  23. Jeff KingMar 3, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.