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

Re: Understanding and improving --word-diff

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 10, 2010, 00:05 UTC
Message-ID
<alpine.DEB.1.00.1011100102540.2226@bonsai2>
In-Reply-To
<20101109220136.GA5617@sigill.intra.peff.net>
Hi,
On Tue, 9 Nov 2010, Jeff King wrote:
Show 20 quoted lines
> On Mon, Nov 08, 2010 at 04:16:01PM +0100, Matthijs Kooijman wrote:
> 
> > E.g., I would like to see:
> > 
> > -a <r>b</r> c
> > +a <g>x</g> c
> > 
> > Unfortunately, all --word-diff types currently departs from line-based 
> > - and + lines and show the new version of the file with the changed 
> > words (both old and new versions) shown inline, marked with coloring 
> > or {- ...  -} kind of syntax. E.g., with --word-diff=color, the above 
> > would look like:
> > 
> > a <r>b</r><g>x</g> c
> > 
> > Personally, I think that the first example above is easier to read 
> > than the second one (at least for diffs of code).
> 
> Yeah, as you figured out, word diff is really about formats that aren't 
> line oriented.

Not really correct. While the _current_ way to show word diffs is imitating GNU wdiff, the internal data structure does allow for more sophisticated output.

Ciao, Dscho

P.S.: Peff, I hope you're fine with me responding to the first sentence only. After all, you know that my attention span is 7.2 seconds.

Some people taught me to put a smiley after such a statement, so: ;-)
Previous: Jeff KingNext: Jeff King
Message 8 of 10 in “Understanding and improving --word-diff”
  1. Matthijs KooijmanNov 8, 2010
  2. Matthieu MoyNov 8, 2010
  3. Matthijs KooijmanNov 8, 2010
  4. Thomas RastNov 8, 2010
  5. Wincent ColaiutaNov 8, 2010
  6. Thomas RastNov 8, 2010
  7. Jeff KingNov 9, 2010
  8. Johannes SchindelinNov 10, 2010
  9. Jeff KingNov 10, 2010
  10. Jeff KingNov 18, 2010

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.