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