Haha - it seems like we've done whitespace cleanup before and it's already a mess again!

Perhaps you should seriously consider taking the more draconian approach like we have and rejecting all commits containing whitespace!  There's nothing funnier then watching Derek prepare a huge patch for MOOSE and then have it bounce back with a wonderful note saying that specific files contain trailing whitespace :)  

Seriously though, this has been one of the better rules we've implemented.  It's never back-fired in any way and we no longer get spurious line changes in every patch.

Cody


On Tue, Apr 2, 2013 at 2:30 PM, Kirk, Benjamin (JSC-EG311) <benjamin.kirk-1@nasa.gov> wrote:
OK, at risk of entering dangerous territory…

I've been using John's recommended git config flags, and have become ashamed of the amount of trailing whitespace I leave in source files.

Consequently, I've added

;--------------------------------------------------
; remove trailing whitespace
(add-hook 'before-save-hook 'delete-trailing-whitespace)

to my ~/.emacs, which is awesome.

Problem is, I'm about to make some serious & important libMesh changes, and I don't want them swamped by a bunch of simultaneous trivial diffs in the same file (read: don't wanna piss off Roy).

I've come up with a gem of a make rule that'll clean our source tree:

# this rule invokes emacs on each source file to remove trailing whitespace.
remove-trailing-whitespace:
        for file in `find $(srcdir)/{src,include,examples} -name "*.C" -o -name "*.h" -o -name Makefile.am -type f` ; do \
          echo $$file ; \
          emacs -batch $$file --eval '(delete-trailing-whitespace)' -f save-buffer 2>/dev/null ; \
        done

Any objections to a massive, whitespace-only commit?

Keep in mind this may unnecessarily complicate merging with any in-work projects…

-Ben


------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel