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

Re: Strange diff behavior?

From
JSJason Sewall <jasonsewall@gmail.com>
Date
Jun 21, 2007, 07:02 UTC
Message-ID
<31e9dd080706210002q4703f464xafa07359f98878cf@mail.gmail.com>
In-Reply-To
<20070621065043.GA30521@moooo.ath.cx>

As I mentioned in the ps, I git-diff --check shows nothing. As a matter of fact, I do have color turned on and the pluses are green and minuses red, but there are none of the characteristic red blocks that trailing whitespace makes.

On 6/20/07, Matthias Lederhofer <matled@gmx.net> wrote:
Show 28 quoted lines
> Jason Sewall <jasonsewall@gmail.com> wrote:
> > It seems like every change listed after the first one is meaningless.
> > I really think I just don't understand something about the diff
> > algorithm. Can someone tell my why those empty lines are recorded as
> > changes?
>
> This are whitespace changes.
>
>     $ git diff --color
>
> marks whitespaces at the end of the line with a red background color
> so you can see what changed.  I also use vim with :set list to see
> whitespace changes, e.g.
>
>     $ git diff | vim -c 'set list' -
>
> If you like to have colors (not just in diff) permnanently you can add
> this to your .git/config or ~/.gitconfig:
>
>     [color]
>         branch = auto
>         diff = auto
>         status = auto
>         pager = true
>
> See also git-config(1) for more information on these and other
> configuration options.
>
Previous: Matthias Lederhofer
Message 7 of 7 in “Strange diff behavior?”
  1. Jason SewallJun 21, 2007
  2. Johannes SchindelinJun 21, 2007
  3. Raimund BauerJun 21, 2007
  4. Johannes SchindelinJun 21, 2007
  5. Jason SewallJun 21, 2007
  6. Matthias LederhoferJun 21, 2007
  7. Jason SewallJun 21, 2007

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.