bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] * HACKING (Avoid trailing white space): Mention how git can help


From: Ralf Wildenhues
Subject: [PATCH] * HACKING (Avoid trailing white space): Mention how git can help.
Date: Tue, 3 Mar 2009 07:46:03 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

---
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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]