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

Re: [BUG] "git diff --word-diff" gives a diff while they are only space changes

From
VLVincent Lefevre <vincent@vinc17.net>
Date
Jun 8, 2026, 10:58 UTC
Message-ID
<20260608105821.GA2049040@cventin.lip.ens-lyon.fr>
In-Reply-To
<CAC2QwmKjr2eiFNPPmERq7n-UjE-SF2vE4eHDanYE-4heWxzQVw@mail.gmail.com>
On 2026-05-28 12:25:01 -0700, Michael Montalbo wrote:
Show 17 quoted lines
> > Thanks for the ideas, Chris. Here is my attempt at synthesizing Chris'
> > suggestions and Junio's feedback:
> >
> >   The `--word-diff` option operates by taking the same line-by-line
> >   diff that is produced without the option and computing
> >   word-by-word changes within each hunk.  This may produce a
> >   larger diff than a dedicated word-diff tool would.  If Git
> >   acquires a different implementation in the future, the output
> >   may change.  Note that this is similar to the `--diff-algorithm`
> >   option, which may also change the output.
> >
> > Does this work?
> 
> Updated the patch with the revised wording:
> https://lore.kernel.org/git/pull.2113.git.1778686956622.gitgitgadget@gmail.com/T/#t
> 
> Please feel free to pick up, modify, or drop as appropriate.
Just to say that this new text is fine for me.
-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
Previous: Michael Montalbo
Message 14 of 14 in “Re: [BUG] "git diff --word-diff" gives a diff while they are only space changes”
  1. Michael MontalboMay 12, 2026
  2. Vincent LefevreMay 12, 2026
  3. Michael MontalboMay 13, 2026
  4. Junio C HamanoMay 14, 2026
  5. Vincent LefevreMay 14, 2026
  6. Phillip WoodMay 15, 2026
  7. Michael MontalboMay 18, 2026
  8. Johannes SixtMay 18, 2026
  9. Michael MontalboMay 19, 2026
  10. Chris TorekMay 19, 2026
  11. Junio C HamanoMay 19, 2026
  12. Michael MontalboMay 20, 2026
  13. Michael MontalboMay 28, 2026
  14. Vincent LefevreJun 8, 2026

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.