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

Re: the war on trailing whitespace

From
DJDave Jones <davej@redhat.com>
Date
Feb 26, 2006, 20:26 UTC
Message-ID
<20060226202617.GH7851@redhat.com>
In-Reply-To
<Pine.LNX.4.64.0602261213340.22647@g5.osdl.org>
On Sun, Feb 26, 2006 at 12:16:25PM -0800, Linus Torvalds wrote:
 > Few enough people run "git-apply" on its own. Most people (certainly me)
 > end up using it through some email-applicator script or other. So the plan
 > was that the --whitespace=warn/error flag would go there, and that
 > git-apply by default would work more like "patch".
 >
 > But hey, I have no strong preferences, and it's easy enough to make the
 > default be warn (and add a "--whitespace=ok" flag to turn it off).
 >
 > Personally, I don't mind whitespace that much. In particular, I _suspect_
 > I often have empty lines like
 >
 >	int i;
 >
 >	i = 10;
 >
 > where the "empty" line actually has the same indentation as the lines
 > around it. Is that wrong? Perhaps.
I think I have the same anal-retentive problem Andrew has, because I have ..

highlight RedundantSpaces term=standout ctermbg=red guibg=red match RedundantSpaces /\s\+$\| \+\ze\t/

in my .vimrc, which highlights this (and other trailing whitespace) as a big red blob. I do this in part for the same reason Andrew does, so that when someone sends me a diff with a zillion spaces at the EOL, it screams at me, I spot them, and chop them out.

		Dave
Previous: Linus TorvaldsNext: Dave Jones
Message 7 of 40 in “the war on trailing whitespace”
  1. Andrew MortonFeb 26, 2006
  2. Junio C HamanoFeb 26, 2006
  3. Andrew MortonFeb 26, 2006
  4. Linus TorvaldsFeb 26, 2006
  5. Andrew MortonFeb 26, 2006
  6. Linus TorvaldsFeb 26, 2006
  7. Dave JonesFeb 26, 2006
  8. Dave JonesFeb 26, 2006
  9. MIke GalbraithFeb 27, 2006
  10. Johannes SchindelinFeb 27, 2006
  11. Andrew MortonFeb 27, 2006
  12. Junio C HamanoFeb 27, 2006
  13. Peter WilliamsFeb 27, 2006
  14. Junio C HamanoFeb 28, 2006
  15. Andrew MortonFeb 27, 2006
  16. git-apply: war on whitespace -- finishing touches.Junio C Hamano, Feb 28, 2006
  17. 1/3 apply: squelch excessive errors and --whitespace=error-allJunio C Hamano, Feb 28, 2006
  18. 2/3 apply --whitespace: configuration option.Junio C Hamano, Feb 28, 2006
  19. Andreas EricssonFeb 28, 2006
  20. Junio C HamanoFeb 28, 2006
  21. Andreas EricssonFeb 28, 2006
  22. 3/3 git-apply --whitespace=nowarnJunio C Hamano, Feb 28, 2006
  23. A Large Angry SCMFeb 28, 2006
  24. Junio C HamanoFeb 28, 2006
  25. Adrien BeauFeb 27, 2006
  26. Andreas EricssonFeb 27, 2006
  27. Uwe ZeisbergerFeb 27, 2006
  28. Andreas EricssonFeb 27, 2006
  29. Peter HagervallFeb 27, 2006
  30. Johannes SchindelinFeb 27, 2006
  31. Randal L. SchwartzFeb 27, 2006
  32. Josef WeidendorferFeb 27, 2006
  33. Adrien BeauFeb 27, 2006
  34. Uwe ZeisbergerFeb 27, 2006
  35. Andreas EricssonFeb 27, 2006
  36. Johannes SchindelinFeb 27, 2006
  37. Junio C HamanoFeb 27, 2006
  38. apply --whitespace fixes and enhancements.Junio C Hamano, Feb 27, 2006
  39. Junio C HamanoFeb 26, 2006
  40. Sam RavnborgFeb 26, 2006

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.