* Re: [PATCH] remove trailing whitespace
[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
0 siblings, 1 reply; 5+ messages in thread
From: Padraig Brady @ 2001-11-23 20:34 UTC (permalink / raw)
To: Mark Hahn; +Cc: linux-kernel, Linus Torvalds
I used sed, but yes the following does
the same as downloading and applying the patch:
find linux -type f | xargs perl -wi -pe 's/[<space><tab>]+$//'
(obviously replace <space> & <tab> with the appropriate chars).
Note also that after (bz2) compression the space saving drops
from 224,654 to 139,669 bytes, which is still good.
Padraig.
Mark Hahn wrote:
> find linux -type f | xargs perl -pe 's/\s+$/\n/'
> wouldn't something like this work? seems generally easier,
> more compact, and probably more Linus-appetizing...
>
>
>>This (23MB! (5Mb compressed)) patch removes trailing whitespace from
>>all files in the kernel, thereby reducing size from 121,865,495 to
>>121,640,841. I.E. reducing size by 224,654 bytes. I don't know if it's
>>of any use, but it should be applied now if it is going to be done
>>at all.
>>
>>http://www.iol.ie/~padraiga/linux-2.5.0-strip-ws.diff.gz
>>
>>cheers,
>>Padraig.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] remove trailing whitespace
2001-11-23 20:34 ` [PATCH] remove trailing whitespace Padraig Brady
@ 2001-11-23 20:45 ` David Weinehall
0 siblings, 0 replies; 5+ messages in thread
From: David Weinehall @ 2001-11-23 20:45 UTC (permalink / raw)
To: Padraig Brady; +Cc: Mark Hahn, linux-kernel, Linus Torvalds
On Fri, Nov 23, 2001 at 08:34:36PM +0000, Padraig Brady wrote:
> I used sed, but yes the following does
> the same as downloading and applying the patch:
> find linux -type f | xargs perl -wi -pe 's/[<space><tab>]+$//'
> (obviously replace <space> & <tab> with the appropriate chars).
>
> Note also that after (bz2) compression the space saving drops
> from 224,654 to 139,669 bytes, which is still good.
>
> Padraig.
Running Lindent on the kerneltree would be far more yielding, as
it would, apart from removing extraoneous whitespace, also format
all code in a sane manner. However, this is unlikely to ever happen; I
seem to recall that Linus has commented on this before.
Regards: David Weinehall
_ _
// David Weinehall <tao@acc.umu.se> /> Northern lights wander \\
// Maintainer of the v2.0 kernel // Dance across the winter sky //
\> http://www.acc.umu.se/~tao/ </ Full colour fire </
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] remove trailing whitespace
@ 2001-11-23 17:20 Padraig Brady
2001-11-25 16:00 ` vda
0 siblings, 1 reply; 5+ messages in thread
From: Padraig Brady @ 2001-11-23 17:20 UTC (permalink / raw)
To: linux-kernel
This (23MB! (5Mb compressed)) patch removes trailing whitespace from
all files in the kernel, thereby reducing size from 121,865,495 to
121,640,841. I.E. reducing size by 224,654 bytes. I don't know if it's
of any use, but it should be applied now if it is going to be done
at all.
http://www.iol.ie/~padraiga/linux-2.5.0-strip-ws.diff.gz
cheers,
Padraig.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] remove trailing whitespace
2001-11-23 17:20 Padraig Brady
@ 2001-11-25 16:00 ` vda
2001-11-25 12:25 ` Russell King
0 siblings, 1 reply; 5+ messages in thread
From: vda @ 2001-11-25 16:00 UTC (permalink / raw)
To: Padraig Brady, linux-kernel
On Friday 23 November 2001 15:20, Padraig Brady wrote:
> This (23MB! (5Mb compressed)) patch removes trailing whitespace from
> all files in the kernel, thereby reducing size from 121,865,495 to
> 121,640,841. I.E. reducing size by 224,654 bytes. I don't know if it's
> of any use, but it should be applied now if it is going to be done
> at all.
>
> http://www.iol.ie/~padraiga/linux-2.5.0-strip-ws.diff.gz
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
--
vda
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] remove trailing whitespace
2001-11-25 16:00 ` vda
@ 2001-11-25 12:25 ` Russell King
0 siblings, 0 replies; 5+ messages in thread
From: Russell King @ 2001-11-25 12:25 UTC (permalink / raw)
To: vda; +Cc: Padraig Brady, linux-kernel
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-11-25 12:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <Pine.LNX.4.10.10111231440260.1920-100000@coffee.psychology.mcmaster.ca>
2001-11-23 20:34 ` [PATCH] remove trailing whitespace Padraig Brady
2001-11-23 20:45 ` David Weinehall
2001-11-23 17:20 Padraig Brady
2001-11-25 16:00 ` vda
2001-11-25 12:25 ` Russell King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox