From 0750d59aeacdcd04239fc9809a3f92323aeb7782 Mon Sep 17 00:00:00 2001 From: James Foster Date: Mon, 15 Feb 2021 10:47:58 -0800 Subject: [PATCH 1/4] Set all text files to have endings --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 4282322a..d56abbf3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ # Set the default behavior, in case people don't have core.autocrlf set. -* text eol=lf +* text=auto eol=lf From 9a76e705ae5ade724727e339428b68b5e84af474 Mon Sep 17 00:00:00 2001 From: James Foster Date: Mon, 15 Feb 2021 11:47:59 -0800 Subject: [PATCH 2/4] Update CHANGELOG.md to describe line endings change. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cac76ad..9a37941b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added ### Changed +- Update .gitattributes so we have consistent line endings ### Deprecated From c88d7d7a51c6339e96763d0c0c22ef2f7d5da7b9 Mon Sep 17 00:00:00 2001 From: James Foster Date: Mon, 15 Feb 2021 20:31:07 -0800 Subject: [PATCH 3/4] Update to more descriptive line ending handling. --- .gitattributes | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index d56abbf3..3f9aff51 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,30 @@ -# Set the default behavior, in case people don't have core.autocrlf set. -* text=auto eol=lf +# https://docs.github.com/en/github/using-git/configuring-git-to-handle-line-endings +# https://git-scm.com/docs/gitattributes +# https://git-scm.com/docs/git-config +# https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/ + +# Configure this repository to use Git's type detection algorithm to guess +# whether a file is text or binary. Text files will have line endings converted +# as if you had set +# eol=native +# That is, on Windows text files will have CRLF line endings in your working +# directory while on Linux and macOS your text files will have LF line endings +# in your working directory. In either case, they will have LF line endings in +# the Git repository itself. + +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. Git would likely get these right, but +# we can be sure by adding them here. +*.c text +*.cpp text +*.h text +*.md text +*.yaml text +*.yml text + +# Denote all files that are truly binary and should not be modified. +# Even if we don't have any of these, they make a good example. +*.png binary +*.jpg binary From aa2ad44e6acde032904638d2ef546fde0577622d Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 6 Apr 2021 16:56:38 -0400 Subject: [PATCH 4/4] Update gitattributes as per PR discussion via https://github.com/Arduino-CI/arduino_ci/pull/285/ --- .gitattributes | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.gitattributes b/.gitattributes index 3f9aff51..640e8d08 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,19 +12,29 @@ # in your working directory. In either case, they will have LF line endings in # the Git repository itself. +# Set the default behavior, in case people don't have core.autocrlf set. * text=auto # Explicitly declare text files you want to always be normalized and converted # to native line endings on checkout. Git would likely get these right, but # we can be sure by adding them here. -*.c text -*.cpp text -*.h text -*.md text -*.yaml text -*.yml text +*.ino text diff=cpp +*.c text diff=c +*.cc text diff=cpp +*.cxx text diff=cpp +*.cpp text diff=cpp +*.c++ text diff=cpp +*.hpp text diff=cpp +*.h text diff=c +*.h++ text diff=cpp +*.hh text diff=cpp + +*.md text +*.yaml text +*.yml text + # Denote all files that are truly binary and should not be modified. # Even if we don't have any of these, they make a good example. -*.png binary -*.jpg binary +*.png binary +*.jpg binary