From: Russell King <rmk@arm.linux.org.uk>
To: vda <vda@port.imtp.ilyichevsk.odessa.ua>
Cc: Padraig Brady <padraig@antefacto.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] remove trailing whitespace
Date: Sun, 25 Nov 2001 12:25:57 +0000 [thread overview]
Message-ID: <20011125122557.A23807@flint.arm.linux.org.uk> (raw)
In-Reply-To: <3BFE8559.1040403@antefacto.com> <01112514004301.00864@manta>
In-Reply-To: <01112514004301.00864@manta>; from vda@port.imtp.ilyichevsk.odessa.ua on Sun, Nov 25, 2001 at 02:00:43PM -0200
On Sun, Nov 25, 2001 at 02:00:43PM -0200, vda wrote:
> Isn't it easier to write a script 'clean_trailing_ws' (or whatever)
> and add it to scripts/ ?
> Linus can apply such 'cleaning' scripts at times like 2.4 -> 2.5
It's best to have a script that you pass all patches through which
strips off trailing space on any line that gets added (you can't
do it blindly since the context lines must obviously match the
original, as must the lines being removed).
I do this automatically when people send stuff to my patch system.
Appears to work well.
It solves the problem of the trailing space getting into the source
in the first place, and doesn't produce a huge 25MB patch.
I suppose you could also remove anything which matched 1-7 spaces
and a tab character, but this might be less reliable. Obviously
you can't replace 8 spaces with a tab character, since it might
be part of a printk string.
If anyone's interested, this is a fragment from the perl script which
processes incoming patches. Might be useful to someone.
#
# And now the actual patch itself
#
while (<STDIN>)
{
chomp;
s/\s+$// if m/^\+/;
$mail .= "$_\n";
$patchtext .= "$_\n";
}
I'm sure someone can come up with something more efficient. 8)
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
next prev parent reply other threads:[~2001-11-25 12:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-23 17:20 [PATCH] remove trailing whitespace Padraig Brady
2001-11-25 16:00 ` vda
2001-11-25 12:25 ` Russell King [this message]
[not found] <Pine.LNX.4.10.10111231440260.1920-100000@coffee.psychology.mcmaster.ca>
2001-11-23 20:34 ` Padraig Brady
2001-11-23 20:45 ` David Weinehall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20011125122557.A23807@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=padraig@antefacto.com \
--cc=vda@port.imtp.ilyichevsk.odessa.ua \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox