diff options
author | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2009-03-02 22:33:05 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-03-04 06:19:49 +0100 |
commit | 0d61f144a318cd54aa903068cbc40276d1b97d22 (patch) | |
tree | cbdd448547a8ec2d485e20247764303e7bdfc4f5 | |
parent | 826095ffad0008f5e19378cfb3e449315e46673d (diff) | |
download | coreutils-0d61f144a318cd54aa903068cbc40276d1b97d22.tar.xz |
policy: use git to help avoid trailing white space
* HACKING (Avoid trailing white space): Describe how git can help.
-rw-r--r-- | HACKING | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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 |