Skip to content

Commit 5d54a08

Browse files
committed
Put .gitattributes under Pantheon upstream control
This way, .gitattributes will be checked out into developer working copies and will have its intended effect, rather than being hidden in the build artifacts. Also link to pantheon.yml documentation
1 parent 6e99102 commit 5d54a08

File tree

4 files changed

+64
-2
lines changed

4 files changed

+64
-2
lines changed

.gitattributes

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Drupal git normalization
2+
# @see https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
# @see https://www.drupal.org/node/1542048
4+
5+
# Normally these settings would be done with macro attributes for improved
6+
# readability and easier maintenance. However macros can only be defined at the
7+
# repository root directory. Drupal avoids making any assumptions about where it
8+
# is installed.
9+
10+
# Define text file attributes.
11+
# - Treat them as text.
12+
# - Ensure no CRLF line-endings, neither on checkout nor on checkin.
13+
# - Detect whitespace errors.
14+
# - Exposed by default in `git diff --color` on the CLI.
15+
# - Validate with `git diff --check`.
16+
# - Deny applying with `git apply --whitespace=error-all`.
17+
# - Fix automatically with `git apply --whitespace=fix`.
18+
19+
*.config text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
20+
*.css text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
21+
*.dist text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
22+
*.engine text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
23+
*.html text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=html
24+
*.inc text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
25+
*.install text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
26+
*.js text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
27+
*.json text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
28+
*.lock text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
29+
*.map text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
30+
*.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
31+
*.module text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
32+
*.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
33+
*.po text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
34+
*.profile text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
35+
*.script text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
36+
*.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
37+
*.sql text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
38+
*.svg text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
39+
*.theme text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
40+
*.twig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
41+
*.txt text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
42+
*.xml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
43+
*.yml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
44+
45+
# Define binary file attributes.
46+
# - Do not treat them as text.
47+
# - Include binary diff in patches instead of "binary files differ."
48+
*.eot -text diff
49+
*.exe -text diff
50+
*.gif -text diff
51+
*.gz -text diff
52+
*.ico -text diff
53+
*.jpeg -text diff
54+
*.jpg -text diff
55+
*.otf -text diff
56+
*.phar -text diff
57+
*.png -text diff
58+
*.svgz -text diff
59+
*.ttf -text diff
60+
*.woff -text diff
61+
*.woff2 -text diff

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ upstream/web/
121121
/web/sites/example.sites.php
122122
/web/themes/README.txt
123123
/.drush-lock-update
124-
/.gitattributes
125124

126125
# Other common rules
127126
# ------------------

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
},
5151
"file-mapping": {
5252
"[project-root]/.editorconfig": false,
53-
"[project-root]/pantheon.upstream.yml": false
53+
"[project-root]/pantheon.upstream.yml": false,
54+
"[project-root]/.gitattributes": false
5455
}
5556
}
5657
},

pantheon.upstream.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
api_version: 1
22
web_docroot: true
3+
# See https://pantheon.io/docs/pantheon-yml/#enforce-https--hsts for valid values.
34
enforce_https: transitional
45
php_version: 7.4
56
drush_version: 10

0 commit comments

Comments
 (0)