summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2012-10-03 22:32:37 -0700
committerwebchick2012-10-03 22:32:37 -0700
commit2750f60e1692193774ef1ea5930621673fe626d0 (patch)
tree6d6c4fb6de2f8d359f5c9ce930245cdc89293274
parentdf56f3fea400b4ec04e396dc715ab695511cdfb4 (diff)
Issue #1111224 by marvil07, bfroehle, sun, dstol, plach, tim.plunkett, nod_, carwin: Added Introduce .gitattributes to end the CRLF/LF and binary diff horror, and detect/auto-fix whitespace errors.
-rw-r--r--.gitattributes51
1 files changed, 51 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..e0ba0f2
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,51 @@
+# Drupal git normalization
+# @see http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
+# @see http://drupal.org/node/1542048
+
+# Shorthand for text files.
+# - Treat them as text.
+# - Ensure no CRLF line-endings, neither on checkout nor on checkin.
+# - Detect whitespace errors.
+# - Exposed by default in `git diff --color` on the CLI.
+# - Validate with `git diff --check`.
+# - Deny applying with `git apply --whitespace=error-all`.
+# - Fix automatically with `git apply --whitespace=fix`.
+[attr]drupaltext text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
+
+# Shorthand for binary files.
+# - Do not treat them as text.
+# - Include binary diff in patches instead of "binary files differ."
+[attr]drupalbinary -text diff
+
+# Auto-detect text files, ensure they use LF.
+* text=auto eol=lf
+
+# Define text file attributes.
+*.css drupaltext
+*.engine drupaltext diff=php
+*.html drupaltext diff=html
+*.inc drupaltext diff=php
+*.info drupaltext
+*.install drupaltext diff=php
+*.js drupaltext
+*.json drupaltext
+*.lock drupaltext
+*.md drupaltext
+*.module drupaltext diff=php
+*.php drupaltext diff=php
+*.po drupaltext
+*.script drupaltext
+*.sh drupaltext diff=php
+*.sql drupaltext
+*.test drupaltext diff=php
+*.txt drupaltext
+*.xml drupaltext
+*.yml drupaltext
+
+# Define binary file attributes.
+*.gif drupalbinary
+*.gz drupalbinary
+*.ico drupalbinary
+*.jpg drupalbinary
+*.png drupalbinary
+*.phar drupalbinary