Re: [PATCH] * HACKING: avoid trailing white space
Hi Jim, Jim Meyering writes: This is obviously incomplete (the FIXME, and no configuration recommendations for Emacs' Whitespace), but we have to start somewhere. As usual, suggestions welcome. Either of these: chmod +x .git/hooks/pre-commit git config apply.whitespace error-all The latter requires pretty recent git, and there are several settings that may be useful. See the manpage for git-apply for details. Cheers, Ralf ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: [PATCH] * HACKING: avoid trailing white space
Ralf Wildenhues wrote: Jim Meyering writes: This is obviously incomplete (the FIXME, and no configuration recommendations for Emacs' Whitespace), but we have to start somewhere. As usual, suggestions welcome. Either of these: chmod +x .git/hooks/pre-commit git config apply.whitespace error-all The latter requires pretty recent git, and there are several settings that may be useful. See the manpage for git-apply for details. Good idea. Thanks! I'll push this tomorrow, unless you'd prefer something else. From 9297e61833f2872125854815a6daf433e949ec64 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues ralf.wildenh...@gmx.de Date: Mon, 2 Mar 2009 22:33:05 +0100 Subject: [PATCH] * HACKING (Avoid trailing white space): Mention how git can help. --- HACKING | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/HACKING b/HACKING index 0675f9c..9b0c593 100644 --- a/HACKING +++ b/HACKING @@ -380,6 +380,17 @@ If you use vim, add this to ~/.vimrc: match RedundantSpaces /\s\+$\| \+\ze\t/ +Git can help too, by stopping you from committing any change that would +add trailing blanks. Depending on the version of git you're using, run +one of these commands to enable the check: + +chmod +x .git/hooks/pre-commit +git config apply.whitespace error-all + +The latter requires pretty recent git, and there are several settings that +may be useful. See the manpage for git-apply for details. + + --- Miscellaneous useful git commands -- 1.6.2.rc1.285.gc5f54 ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
[PATCH] * HACKING (Avoid trailing white space): Mention how git can help.
--- Hi Jim, * Jim Meyering wrote on Mon, Mar 02, 2009 at 10:34:41PM CET: Good idea. Thanks! I'll push this tomorrow, unless you'd prefer something else. How about this instead? I looked at git a bit more, and have little experience with git apply (not sure whether it's used all over the place or not), so let's make that less prominent. Cheers, Ralf HACKING | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/HACKING b/HACKING index 0675f9c..47cf887 100644 --- a/HACKING +++ b/HACKING @@ -380,6 +380,21 @@ If you use vim, add this to ~/.vimrc: match RedundantSpaces /\s\+$\| \+\ze\t/ +Git can help too, by stopping you from committing any change that would +add trailing blanks. The example pre-commit hook contains code to check +for trailing whitespace and spaces before tabs; enable it by moving it +to the right place and making it executable: + +chmod +x .git/hooks/pre-commit + +To manually check for whitespace errors before committing, you can use + +git diff --check + +Git also has some settings to enable suitable internal whitespace checks. +See the manpage for git-apply for details. + + --- Miscellaneous useful git commands -- 1.6.1.505.gba743 ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: [PATCH] * HACKING (Avoid trailing white space): Mention how git can help.
Ralf Wildenhues wrote: * Jim Meyering wrote on Mon, Mar 02, 2009 at 10:34:41PM CET: Good idea. Thanks! I'll push this tomorrow, unless you'd prefer something else. How about this instead? I looked at git a bit more, and have little experience with git apply (not sure whether it's used all over the place or not), so let's make that less prominent. Thanks Ralf. Looks good, but I had to make an additional change, since the procedure changed in git-1.5.6.1. From 937ade894d77d16f3ba39d2547b68d55e330d3ad Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues ralf.wildenh...@gmx.de Date: Mon, 2 Mar 2009 22:33:05 +0100 Subject: [PATCH] * HACKING (Avoid trailing white space): Mention how git can help. --- HACKING | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/HACKING b/HACKING index 0675f9c..ad3e39f 100644 --- a/HACKING +++ b/HACKING @@ -380,6 +380,25 @@ If you use vim, add this to ~/.vimrc: match RedundantSpaces /\s\+$\| \+\ze\t/ +Git can help too, by stopping you from committing any change that would +add trailing blanks. The example pre-commit hook contains code to check +for trailing whitespace and spaces before tabs; enable it by moving it +to the right place and making sure it is executable: + +mv .git/hooks/pre-commit.sample .git/hooks/pre-commit + +With a repository created by git-1.5.6 or older, use this command: + +chmod +x .git/hooks/pre-commit + +To manually check for whitespace errors before committing, you can use + +git diff --check + +Git also has some settings to enable suitable internal whitespace checks. +See the manpage for git-apply for details. + + --- Miscellaneous useful git commands -- 1.6.2.rc1.285.gc5f54 ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
[PATCH] * HACKING: avoid trailing white space
This is obviously incomplete (the FIXME, and no configuration recommendations for Emacs' Whitespace), but we have to start somewhere. As usual, suggestions welcome. From d88c9f95e38cb86460ba4acaf90b24c3c8fce8bf Mon Sep 17 00:00:00 2001 From: Jim Meyering meyer...@redhat.com Date: Wed, 25 Feb 2009 15:37:58 +0100 Subject: [PATCH] * HACKING: avoid trailing white space --- HACKING | 24 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/HACKING b/HACKING index bf9a45e..0675f9c 100644 --- a/HACKING +++ b/HACKING @@ -356,6 +356,30 @@ With other files, there will be some existing differences. Try not to add any more. +Avoid trailing white space +== +You may notice that the only trailing blanks in coreutils' +version-controlled files are in a single directory: tests/pr, +which contains expected output from various invocations of pr. + +Do not add any more trailing blanks anywhere. While make syntax-check +will alert you if you slip up, it's better to nip any problem in the +bud, as you're typing. A good way to help you adapt to this rule is +to configure your editor to highlight any offending characters in the +files you edit. If you use Emacs, customize its font-lock mode (FIXME: +provide more detail) or try one of its whitespace packages. This appears +to be the one that will end up in emacs 23: + +http://www.emacswiki.org/emacs/WhiteSpace + +[that page says its version also works with emacs 21 and 22] +If you use vim, add this to ~/.vimrc: + +let c_space_errors=1 +highlight RedundantSpaces ctermbg=red guibg=red +match RedundantSpaces /\s\+$\| \+\ze\t/ + + --- Miscellaneous useful git commands -- 1.6.2.rc1.285.gc5f54 ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils