summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes2
-rw-r--r--scripts/gitsetup.sh3
2 files changed, 4 insertions, 1 deletions
diff --git a/.gitattributes b/.gitattributes
index 10605e3d..66254021 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -6,7 +6,7 @@
* text=auto
Make* tabs
*.mk tabs
-*.[ch] tabs
+*.[chm] tabs
*.java tabs
*.xml tabs
memento.* spaces
diff --git a/scripts/gitsetup.sh b/scripts/gitsetup.sh
index 10f2321e..1c932212 100644
--- a/scripts/gitsetup.sh
+++ b/scripts/gitsetup.sh
@@ -1,5 +1,8 @@
#!/bin/bash
+# Tell git to fix whitespace errors automatically
+git config apply.whitespace fix
+
# Set up useful aliases:
git config alias.wsfix "! git diff HEAD >P.diff && git apply -R P.diff && git apply --whitespace=fix P.diff && rm P.diff"
git config alias.wsfixi "! git diff --cached >P.diff && git apply --cached -R P.diff && git apply --cached --whitespace=fix P.diff && rm P.diff"