Skip to contentSkip to conversation

2273 lines in 170 files consists of only space and tabulators

DISCUSSION Felix Zielcke 5 participants 15 messages Jun 6, 2009 – Aug 1, 2009

lore
Share & tools
lore
#0 lore raw
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|wc -l
2273
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|sed -e 's/:.*//'|uniq|wc -l
170

Anyone wants me to do
find . -type f -print0 | xargs -0 sed -i -r -e 's/^[[:blank:]]+$//' or does someone object?
[:blank:] doestn't contain these ^L chars.

By the way `git diff --color' shows if you introduce such a line with red, but strangely not when you remove one.

Signature · 1 line
Felix Zielcke
#1 lore raw

Am Samstag, den 06.06.2009, 12:25 +0200 schrieb Felix Zielcke:

Quoted 4 lines
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|wc -l
2273
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|sed -e 's/:.*//'|uniq|wc -l
170

Seems like the regexp isn't clear for everyone, at least Vladimir. This matches only lines with have at least one space or one tab, not totally empty lines.
And the sed would only change them to true empty lines, not remove them completely.

Quoted 2 lines

Felix Zielcke

#2 lore raw

Hello

Quoted 11 lines · Felix Zielcke

Am Samstag, den 06.06.2009, 12:25 +0200 schrieb Felix Zielcke:

Quoted 4 lines
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|wc -l
2273
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|sed -e 's/:.*//'|uniq|wc -l
170

Seems like the regexp isn't clear for everyone, at least Vladimir. This matches only lines with have at least one space or one tab, not totally empty lines.
And the sed would only change them to true empty lines, not remove them completely.

As was discussed on IRC and confirmed by looking at GCS it doesn't specify explicitely whether empty lines whould contain spaces. We can use either way as long as we use it consistently. I haven't yet found how to install ident on gentoo. If ident removes these spaces too I think we should remove them too as it's easier to maintain if style is the same as from ident

Quoted 10 lines
Quoted 2 lines

Felix Zielcke

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 2 lines
Regards
Vladimir 'phcoder' Serbinenko
#5 lore raw
In reply to Felix Zielcke
Quoted 5 lines · Felix Zielcke
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|wc -l
2273
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|sed -e 's/:.*//'|uniq|wc -l
170
Quoted 7 lines

Anyone wants me to do
find . -type f -print0 | xargs -0 sed -i -r -e 's/^[[:blank:]]+$//' or does someone object?
[:blank:] doestn't contain these ^L chars.

By the way `git diff --color' shows if you introduce such a line with red, but strangely not when you remove one.

Since we have linear development, it shouldn't be a problem for merging patches. Besides, "patch" can be told to ignore whitespace differences.

However, I would prefer that we remove all trailing whitespace, not just that on empty lines. That is, remove "^" from the sed expression.

As for the script, make sure that it's not run on any special files used by Subversion or git. Maybe use DISTLIST.

Signature · 2 lines
Regards,
Pavel Roskin
#3 lore raw
In reply to Vladimir 'phcoder' Serbinenko
Quoted 6 lines · Vladimir 'phcoder' Serbinenko

As was discussed on IRC and confirmed by looking at GCS it doesn't specify explicitely whether empty lines whould contain spaces. We can use either way as long as we use it consistently. I haven't yet found how to install ident on gentoo. If ident removes these spaces too I think we should remove them too as it's easier to maintain if style is the same as from ident

Yes, indent removes trailing whitespace everywhere except comments.

By the way, our style is slightly different from that used by GNU indent. GRUB uses space after "!", whereas GNU indent doesn't. Also, some GRUB sources use one space before labels, and GNU indent starts labels from the first column.

Signature · 2 lines
Regards,
Pavel Roskin
#4 lore raw

Am Samstag, den 06.06.2009, 21:59 -0400 schrieb Pavel Roskin:

Quoted 4 lines

By the way, our style is slightly different from that used by GNU indent. GRUB uses space after "!", whereas GNU indent doesn't. Also, some GRUB sources use one space before labels, and GNU indent starts labels from the first column.

I just noticed that emacs indents util/grub.d/30_os-prober different then it was written.
And the coding style isn't always that consistent.
For example sometimes if (! pointer)' is used and sometimes if (pointer == NULL)'

Signature · 1 line
Felix Zielcke
#6 lore raw
In reply to Pavel Roskin

Am Samstag, den 06.06.2009, 21:53 -0400 schrieb Pavel Roskin:

Quoted 11 lines · Felix Zielcke
Quoted 10 lines
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|wc -l
2273
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|sed -e 's/:.*//'|uniq|wc -l
170

Anyone wants me to do
find . -type f -print0 | xargs -0 sed -i -r -e 's/^[[:blank:]]+$//' or does someone object?
[:blank:] doestn't contain these ^L chars.

Quoted 8 lines
Quoted 2 lines

By the way `git diff --color' shows if you introduce such a line with red, but strangely not when you remove one.

Since we have linear development, it shouldn't be a problem for merging patches. Besides, "patch" can be told to ignore whitespace differences.

However, I would prefer that we remove all trailing whitespace, not just that on empty lines. That is, remove "^" from the sed expression.

Ok I just commited this.

Quoted 2 lines

As for the script, make sure that it's not run on any special files used by Subversion or git. Maybe use DISTLIST.

Thanks for the hint with DISTLIST. gendistlist.sh needed again an update.

Signature · 1 line
Felix Zielcke
#7 lore raw
Quoted 15 lines · Felix Zielcke

Am Samstag, den 06.06.2009, 21:53 -0400 schrieb Pavel Roskin:

Quoted 14 lines · Felix Zielcke
Quoted 12 lines
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|wc -l
2273
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|sed -e 's/:.*//'|uniq|wc -l
170

Anyone wants me to do
find . -type f -print0 | xargs -0 sed -i -r -e 's/^[[:blank:]]+$//' or does someone object?
[:blank:] doestn't contain these ^L chars.

By the way `git diff --color' shows if you introduce such a line with red, but strangely not when you remove one.

Quoted 7 lines
Quoted 5 lines

Since we have linear development, it shouldn't be a problem for merging patches. Besides, "patch" can be told to ignore whitespace differences.

However, I would prefer that we remove all trailing whitespace, not just that on empty lines. That is, remove "^" from the sed expression.

Ok I just commited this.

Do you mean removing all whitespace? I think you forgot to commit it.

Though, I'd prefer if we don't do this in one megacommit. If we do it gradually, we avoid breaking patches. This makes work easier for branches and for distributors (which essentially operate as a branch).

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#8 lore raw

Am Dienstag, den 28.07.2009, 20:19 +0200 schrieb Robert Millan:

Quoted 22 lines · Felix Zielcke
Quoted 21 lines

Am Samstag, den 06.06.2009, 21:53 -0400 schrieb Pavel Roskin:

Quoted 19 lines · Felix Zielcke
Quoted 5 lines
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|wc -l
2273
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|sed -e 's/:.*//'|uniq|wc -l
170
Quoted 7 lines

Anyone wants me to do
find . -type f -print0 | xargs -0 sed -i -r -e 's/^[[:blank:]]+$//' or does someone object?
[:blank:] doestn't contain these ^L chars.

By the way `git diff --color' shows if you introduce such a line with red, but strangely not when you remove one.

Since we have linear development, it shouldn't be a problem for merging patches. Besides, "patch" can be told to ignore whitespace differences.

However, I would prefer that we remove all trailing whitespace, not just that on empty lines. That is, remove "^" from the sed expression.

Quoted 7 lines
Quoted 1 line

Ok I just commited this.

Do you mean removing all whitespace? I think you forgot to commit it.

Though, I'd prefer if we don't do this in one megacommit. If we do it gradually, we avoid breaking patches. This makes work easier for branches and for distributors (which essentially operate as a branch).

I did this in r2293
So you even didn't notice this. Good :)

Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer
#9 lore raw
Quoted 25 lines · Felix Zielcke

Am Dienstag, den 28.07.2009, 20:19 +0200 schrieb Robert Millan:

Quoted 24 lines · Felix Zielcke
Quoted 22 lines

Am Samstag, den 06.06.2009, 21:53 -0400 schrieb Pavel Roskin:

Quoted 11 lines · Felix Zielcke
Quoted 10 lines
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|wc -l
2273
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|sed -e 's/:.*//'|uniq|wc -l
170

Anyone wants me to do
find . -type f -print0 | xargs -0 sed -i -r -e 's/^[[:blank:]]+$//' or does someone object?
[:blank:] doestn't contain these ^L chars.

Quoted 8 lines
Quoted 2 lines

By the way `git diff --color' shows if you introduce such a line with red, but strangely not when you remove one.

Since we have linear development, it shouldn't be a problem for merging patches. Besides, "patch" can be told to ignore whitespace differences.

However, I would prefer that we remove all trailing whitespace, not just that on empty lines. That is, remove "^" from the sed expression.

Ok I just commited this.

Quoted 8 lines
Quoted 5 lines

Do you mean removing all whitespace? I think you forgot to commit it.

Though, I'd prefer if we don't do this in one megacommit. If we do it gradually, we avoid breaking patches. This makes work easier for branches and for distributors (which essentially operate as a branch).

I did this in r2293
So you even didn't notice this. Good :)

But there was no ChangeLog entry?

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#10 lore raw

Am Freitag, den 31.07.2009, 17:39 +0200 schrieb Robert Millan:

Quoted 28 lines · Felix Zielcke
Quoted 27 lines

Am Dienstag, den 28.07.2009, 20:19 +0200 schrieb Robert Millan:

Quoted 26 lines · Felix Zielcke
Quoted 15 lines

Am Samstag, den 06.06.2009, 21:53 -0400 schrieb Pavel Roskin:

Quoted 14 lines · Felix Zielcke
Quoted 12 lines
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|wc -l
2273
fz@fz:~/grub/grub2.git$ rgrep -E "^[[:blank:]]+$" *|sed -e 's/:.*//'|uniq|wc -l
170

Anyone wants me to do
find . -type f -print0 | xargs -0 sed -i -r -e 's/^[[:blank:]]+$//' or does someone object?
[:blank:] doestn't contain these ^L chars.

By the way `git diff --color' shows if you introduce such a line with red, but strangely not when you remove one.

Quoted 7 lines
Quoted 5 lines

Since we have linear development, it shouldn't be a problem for merging patches. Besides, "patch" can be told to ignore whitespace differences.

However, I would prefer that we remove all trailing whitespace, not just that on empty lines. That is, remove "^" from the sed expression.

Ok I just commited this.

Do you mean removing all whitespace? I think you forgot to commit it.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

Though, I'd prefer if we don't do this in one megacommit. If we do it gradually, we avoid breaking patches. This makes work easier for branches and for distributors (which essentially operate as a branch).

I did this in r2293
So you even didn't notice this. Good :)

But there was no ChangeLog entry?

Uhm I thought this wasn't needed because the actual code didn't change. But okay GCS talks about all changes made to source files so you're probable right.

Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer
#11 lore raw

Am Freitag, den 31.07.2009, 17:45 +0200 schrieb Felix Zielcke:

Quoted 8 lines
Quoted 2 lines

But there was no ChangeLog entry?

Uhm I thought this wasn't needed because the actual code didn't change.
But okay GCS talks about all changes made to source files so you're probable right.

Ok thanks to grep and sed I added it now.
Sorry.

Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer
#12 lore raw
Quoted 2 lines · Felix Zielcke

Ok thanks to grep and sed

The way of a true hacker. :-)

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#13 lore raw
In reply to Felix Zielcke

Uhm I thought this wasn't needed because the actual code didn't change. But okay GCS talks about all changes made to source files so you're probable right.

Usually, such changes do not need to be mentioned in the ChangeLog, since they do not change the behaviour of anything. The same goes for any formating changes, and comment fixes.

#14 lore raw

Am Samstag, den 01.08.2009, 06:05 -0400 schrieb Alfred M. Szmidt:

Quoted 8 lines

Uhm I thought this wasn't needed because the actual code didn't
change. But okay GCS talks about all changes made to source files so you're probable right.

Usually, such changes do not need to be mentioned in the ChangeLog, since they do not change the behaviour of anything. The same goes for any formating changes, and comment fixes.

Pavel once told me about 6.8.3 in GCS which says:

When you change just comments or doc strings, it is enough to write an entry for the file, without mentioning the functions. Just “Doc fixes” is enough for the change log

So at least comment changes should be documented.

Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer