Return to Snippet

Revision: 8330
at September 15, 2008 06:52 by benpjohnson


Initial Code
.git/hooks/pre-commit 2>&1 | sed '/^\*/d' | sed 's/:.*//' | uniq

for FILE in `.git/hooks/pre-commit 2>&1 | sed '/^\*/d' | sed 's/:.*//' | uniq` ; do sed -ie 's/[[:space:]]*$//' $FILE ; done

Initial URL

                                

Initial Description
Pre 1.6 git has some annoying whitespace checking in it's pre-commit hook. Rather than turn it off I decided to have a go at an automated method to fix the issue.

Running the first line lists the files that have problems. The second just adds a sed to fix the issue

Initial Title
Git whitespace fixes for windows newlines

Initial Tags
Bash, windows, git

Initial Language
Bash