[Nfd-dev] trailing whitespace

Alex Afanasyev alexander.afanasyev at ucla.edu
Thu Mar 27 13:51:54 PDT 2014


Hi guys,

It isn't a strict requirement, but as a suggestion, the trailing whitespace is always looks odd in source files (and is marked red on gerrit).  I do not want to introduce any intrusive options as it could be dangerious, but there is a simple way git itself can warn you/force to remove it before creating commits.

Just copy default pre-comit hook  .git/hooks/pre-commit.sample hook as .git/hooks/pre-commit and it should work:

    cp .git/hooks/pre-commit.sample .git/hooks/pre-commit

The behavior can be additionally adjusted, but default configuration is good enough to prevent creation of commits with trailing whitespace.

---
Alex





More information about the Nfd-dev mailing list