Check out
$ man git-stripspace
and
http://git-scm.com/book/ch7-1.html#Formatting-and-Whitespace.