summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/git-un-diff-whitespace8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/git-un-diff-whitespace b/bin/git-un-diff-whitespace
index 6338a47..4e71f04 100755
--- a/bin/git-un-diff-whitespace
+++ b/bin/git-un-diff-whitespace
@@ -1,5 +1,13 @@
#!/usr/bin/python
+# Strip trailing whitespace ONLY in modified sections in the latest commit.
+# Usage:
+# <edit files>
+# $ git commit
+# $ git un-diff-whitespace
+# Copyright 2010 Colin Walters <walters@verbum.org>
+# Licensed under the new-BSD license (http://www.opensource.org/licenses/bsd-license.php)
+
import os,sys,re,subprocess
hunk_re = re.compile(r'^@@ -\d+,\d+ \+(\d+),(\d+) @@')