« Home | Export your Outlook Calendar to Google Calendar » | T-mobile BlackBerry Curve SIM unlock, part 1 » | MicroISV on a Shoestring » | Looking Back and Looking Forward » | GrandCentral Web Call Button » | Marketing with Trinkets » | BlackBerry Curve 83xx versus T-Mobile DASH » | Deluxe Responds » | Happy New Year! » | Three Screens are Better Than One »

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", $_);
}




Mangled by ScribeFire and fixed by hand.

Labels: ,

To fix it, don't make trailing whitespace errors!

The check is there to prevent whitespace errors from entering the repository.

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.

Post a Comment