Git не будет обрабатывать файл .html как двоичный файл, даже если он помечен как таковой в .gitattributes - PullRequest
0 голосов
/ 25 марта 2019

Я пытаюсь заставить git пометить скомпилированный код как двоичный, чтобы очистить diff. По большей части это работает, но не для .html файлов.

Вот мой .gitattributes

web/themes/custom/*/css/** -diff
web/themes/custom/*/dist/** -diff
web/themes/custom/*/pattern-lab/** -diff
web/themes/custom/*/pattern-lab/**/*.html -diff
web/themes/custom/columbia_sps/pattern-lab/public/patterns/00-base-global-01-colors-colors/00-base-global-01-colors-colors.html -diff

Как видите, эти две последние строки - мои попытки заставить его работать с чем-то более конкретным.

А вот и разница

$ git show b118f56069f96cd9f1c60ca9d8eca1a213aeabc1
diff --git a/web/themes/custom/columbia_sps/dist/style.css b/web/themes/custom/columbia_sps/dist/style.css
index 2af390be7..9e0570210 100644
Binary files a/web/themes/custom/columbia_sps/dist/style.css and b/web/themes/custom/columbia_sps/dist/style.css differ
diff --git a/web/themes/custom/columbia_sps/dist/style.css.map b/web/themes/custom/columbia_sps/dist/style.css.map
index c558df481..1a6ac917c 100644
Binary files a/web/themes/custom/columbia_sps/dist/style.css.map and b/web/themes/custom/columbia_sps/dist/style.css.map differ
diff --git a/web/themes/custom/columbia_sps/pattern-lab/public/latest-change.txt b/web/themes/custom/columbia_sps/pattern-lab/public/latest-change.txt
index b8064ad75..cdea372dd 100644
Binary files a/web/themes/custom/columbia_sps/pattern-lab/public/latest-change.txt and b/web/themes/custom/columbia_sps/pattern-lab/public/latest-change.txt differ
diff --git a/web/themes/custom/columbia_sps/pattern-lab/public/patterns/00-base-global-01-colors-colors/00-base-global-01-colors-colors.html b/web/themes/custom/columbia_sps/pattern-lab/public/patterns/00-base-global-01-colors-colors/00-base-global-01-colors-colors.html
index 733999083..a9e9ba436 100644
--- a/web/themes/custom/columbia_sps/pattern-lab/public/patterns/00-base-global-01-colors-colors/00-base-global-01-colors-colors.html
+++ b/web/themes/custom/columbia_sps/pattern-lab/public/patterns/00-base-global-01-colors-colors/00-base-global-01-colors-colors.html
@@ -45,10 +45,10 @@
     <link rel="stylesheet" href="/libraries/select2/dist/css/select2.min.css"  media="all" />

     <!-- Pattern Lab base styles. -->
-    <link rel="stylesheet" href="../../../../dist/styleguide-specific.css?cacheBuster=1553203845">
+    <link rel="stylesheet" href="../../../../dist/styleguide-specific.css?cacheBuster=1553539945">

     <!-- Component styles -->
-    <link rel="stylesheet" href="../../../../dist/style.css?1553203845" media="all" />
+    <link rel="stylesheet" href="../../../../dist/style.css?1553539945" media="all" />

     <!-- Drupal-specific usage -->
     <!-- example using symlinking -->
<snip>

Так что, похоже, он работает для всех типов файлов , за исключением .html, хотя я явно перечисляю этот файл в .gitattributes.

Почему?

1 Ответ

1 голос
/ 27 марта 2019

Судя по комментариям, проблема заключалась в том, что в файловой системе находился файл .gitattributes, который переопределял файл .gitattributes верхнего уровня.

...