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

Re: [RFC] Representation of diff with trailing spaces

From
Jeff King <peff@peff.net>
Date
Mar 26, 2020, 11:15 UTC
Message-ID
<20200326111500.GB4193632@coredump.intra.peff.net>
In-Reply-To
<CABt=S26FB1zkwDCdmXeyVvFYvpvuGSX_y1Fg5N3K=yq0ZMyR7A@mail.gmail.com>
On Thu, Mar 26, 2020 at 12:07:55PM +0100, Sébastien BRUCKERT wrote:
Show 7 quoted lines
> # Abstract
> Something that always bothered me with git diff was how trailing
> spaces are represented. If I add spaces, then diff, they are
> represented in the terminal by a red background. If I then remove
> them, they are not represented. That's how I can have a diff with two
> exact lines, and I'm looking for the diff in it, but can't find it.
> Because it is the non-represented spaces.

Have you tried setting diff.wsErrorHighlight? By default we only highlight whitespace problems in new lines, but it can be told to show them in old lines or in context.

-Peff
Previous: Sébastien BRUCKERTNext: Sébastien BRUCKERT
Message 2 of 3 in “[RFC] Representation of diff with trailing spaces”
  1. Sébastien BRUCKERTMar 26, 2020
  2. Jeff KingMar 26, 2020
  3. Sébastien BRUCKERTMar 26, 2020

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.