

Taking corrective action with git pre-commit - mattbaker
http://eng.wealthfront.com/2011/03/corrective-action-with-gits-pre-commit.html

======
pilif
If you are working with a legacy repository that might still have some files
in it with whitespace issues (if you are using svn, you are not merging and
thus not caring about trailing whitespace), this is a sure-fire way to create
commits that change both code and whitespace.

Worse than not fixing trailing whitespace (or only fixing it in the lines you
are actually changing) is fixing whitespace AND changing the code in the same
commit.

Doing something like what's proposed in the article is acceptable as long as
you do even more shell magic so it only works on lines actually touched by the
commit.

Same goes for scripts running on the server (just doing validation there of
course!). You can only act on lines actually changed by the commit if you're
dealing with repositories imported from pre-git days, or you will be seriously
hated by your teammates :-)

~~~
2is10
If you're working with a legacy repository, quit your job. Work somewhere
where you are empowered to do what will make you and your team more efficient.
I nuked trailing whitespace in our whole repo at wealthfront when I added the
whitespace check to our pre-commit hook.

