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

Re: Bug report: "Use of uninitialized value $_ in print"

From
Jeff King <peff@peff.net>
Date
Mar 3, 2018, 06:18 UTC
Message-ID
<20180303061802.GJ27689@sigill.intra.peff.net>
In-Reply-To
<xmqqd10mb0v7.fsf@gitster-ct.c.googlers.com>
On Fri, Mar 02, 2018 at 01:53:32PM -0800, Junio C Hamano wrote:
Show 18 quoted lines
> Sam Kuper <sam.kuper@uclmail.net> writes:
> 
> > 1. It would yield, IIUC, less flexibility to create new kinds of view
> > based on a consistent, standardised underlying model.
> >
> > 2. It is harder to read, for some types of input (e.g. prose) than the
> > view generated by the existing word-diff algorithm.
> 
> The loss of line-end by the lossy "word-diff" output does not matter
> if you never split hunks, but to be able to split a hunk at an
> in-between context line (which you can already do) and new features
> like per-line selection that are emerging, keeping 1:1 line
> correspondence between what is shown and what is applied is a must.
> 
> Unless you are volunteering to design (notice that I am not saying
> "implement") both diff generation/coloration side _and_ patch
> application side, that is.  In which case, you may be able to come
> up with a magic ;-)

IIRC, we do the word-diff by first finding the individual hunks with a normal line diff, and then doing a word diff inside those hunks. So one easy option would be to add a --color-words option that gets passed along to the underlying display diff and just disables hunk splitting. I think we'd also need to start parsing the DISPLAY hunks more carefully to make sure we re-sync at hunk boundaries.

-Peff
Previous: Junio C Hamano
Message 23 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.