Skip to contentSkip to conversation

whitespace removal

FYI Christian Trefzer 2 participants 3 messages Apr 30, 2006

lore
Share & tools
lore
#0 lore raw

Hi there,

while fiddling with some driver development I noticed the disturbing effect of trailing whitespace while comparing functionally different versions of a driver. Since even git pukes when it encounters some, I did

	find -type f | xargs sed -e"s/\(\t\|\ \)*$//" -i

on Linus' current git to estimate the dimension of the mess, and the resulting diff was 25MB in size. Mebibytes, that is (and yuck, what an un-word). Granted, for one line that has its whitespace removed we get roughly eight lines in the diff, so this is mostly bloat.

I ended up sending cleanup patches to the maintainers of the external / internal repository of that driver respectively, but looking at the size of this "simple" no-op change, I'd rather leave it to driver or subsystem maintainers to Do The Right Thing in itty bitty steps.

Not trying to be pedantic here, and even less trying to start a flame war.

Kind regards,
Chris

#1 lore raw

2006/5/1, Christian Trefzer <[email protected]>:

Quoted 2 lines

Granted, for one line that has its whitespace removed we get roughly eight lines in the diff, so this is mostly bloat.

Use "diff -b".

#2 lore raw

Hi Dmitry,

Quoted 2 lines · Dmitry Fedorov

Use "diff -b".

diff -b would be useful to ignore whitespace in comparisons, thanks for opening my eyes. I doubt it would be useful while creating cleanup patches, though ; )

Kind regards,
Chris