git: Tralining whitespace error during commit
I'm using git more and more. However, when checking in code, I sometimes get an error about trailing whitespace and the commit fails.
To fix this:
in .git/hooks/pre-commit, delete the following lines:
if (/\s$/) {
bad_line("trailing whitespace", $_);
}
To fix this:
in .git/hooks/pre-commit, delete the following lines:
if (/\s$/) {
bad_line("trailing whitespace", $_);
}
Mangled by ScribeFire and fixed by hand.
Labels: OpenSource, Programming
To fix it, don't make trailing whitespace errors!
The check is there to prevent whitespace errors from entering the repository.
Posted by
Anonymous |
May 5, 2009 6:15 AM
I disagree that whitespace is an error.
Unfortunately, those of us who work with teams and synchronize with subversion repositories aren't so lucky, especially when some developers take reformatting their code as a personal attack. Some languages like Python take whitespace very seriously.
Posted by
Joe Turner |
May 5, 2009 11:21 AM