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

Re: [SCRIPT] chomp: trim trailing whitespace

From
JGJeff Garzik <jeff@garzik.org>
Date
May 27, 2006, 11:32 UTC
Message-ID
<447838EB.9060900@garzik.org>
In-Reply-To
<Pine.LNX.4.61.0605271212210.6670@yvahk01.tjqt.qr>
Jan Engelhardt wrote:
Show 13 quoted lines
>> Attached to this email is chomp.pl, a Perl script which removes trailing
>> whitespace from several files.  I've had this for years, as trailing whitespace
>> is one of my pet peeves.
>>
>> Now that git-applymbox complains loudly whenever a patch adds trailing
>> whitespace, I figured this script may be useful to others.
>>
> 
> Pretty long script. How about this two-liner? It does not show 'bytes 
> chomped' but it also trims trailing whitespace.
> 
> #!/usr/bin/perl -i -p
> s/[ \t\r\n]+$//
Yes, it does, but a bit too aggressive for what we need :)
	Jeff
Previous: Neil BrownNext: Dmitry Fedorov
Message 5 of 11 in “[SCRIPT] chomp: trim trailing whitespace”
  1. Jeff GarzikMay 27, 2006
  2. Jan EngelhardtMay 27, 2006
  3. Thomas GlanzmannMay 27, 2006
  4. Neil BrownMay 27, 2006
  5. Jeff GarzikMay 27, 2006
  6. Dmitry FedorovMay 27, 2006
  7. Jan EngelhardtMay 27, 2006
  8. Keith OwensMay 28, 2006
  9. Martin LanghoffMay 27, 2006
  10. Linus TorvaldsMay 27, 2006
  11. Johannes SchindelinMay 28, 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.