summaryrefslogtreecommitdiff
path: root/HACKING
diff options
context:
space:
mode:
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>2009-03-02 22:33:05 +0100
committerJim Meyering <meyering@redhat.com>2009-03-04 06:19:49 +0100
commit0d61f144a318cd54aa903068cbc40276d1b97d22 (patch)
treecbdd448547a8ec2d485e20247764303e7bdfc4f5 /HACKING
parent826095ffad0008f5e19378cfb3e449315e46673d (diff)
downloadcoreutils-0d61f144a318cd54aa903068cbc40276d1b97d22.tar.xz
policy: use git to help avoid trailing white space
* HACKING (Avoid trailing white space): Describe how git can help.
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING19
1 files changed, 19 insertions, 0 deletions
diff --git a/HACKING b/HACKING
index 0675f9c57..ad3e39f00 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