git diff --word-diff misbehaving over paragraph breaks?

From: Willow Liquorice <hidden>
Date: 2024-08-22 19:08:42

I'm having some trouble diffing revisions of the Jargon File at the word 
level, because the formatting seems to be confusing git diff 
--word-‍diff. The diffs produced are far from minimal, or word diffs for 
that matter.

I've attached a pair of files that produces non-minimal output. The 
entire first paragraph of the diff is rewritten in the diff despite the 
fact that it is nearly identical across revisions. The word diff can be 
made sensible by removing the second blank line so that the term and 
definition are no longer in separate "paragraphs".

The behaviour persists whether I set the word regex to 
"[[:punct:]]+|[[:alnum:]]+" or use the default word regex.

IMO this behaviour is aberrant: whitespace is whitespace regardless of 
whether it constitutes a paragraph break or not. Is there a command line 
option, or specific way of phrasing the regex, that I'm missing, or is 
this a bug?

	- Willow Liquorice

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help