From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Meng Date: Wed, 23 Oct 2019 20:11:50 -0700 Subject: [U-Boot] [PATCH v2 6/8] Add .gitattributes for line endings In-Reply-To: <1571886712-24514-1-git-send-email-bmeng.cn@gmail.com> References: <1571886712-24514-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1571886712-24514-7-git-send-email-bmeng.cn@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de When building U-Boot host tools for Windows from Microsoft Azure Pipelines, we see tons of weird warnings and errors emitted from every Kconfig files: Kconfig:6:warning: ignoring unsupported character '' Kconfig:6:warning: ignoring unsupported character '' Kconfig:8:warning: ignoring unsupported character '' Kconfig:9:warning: ignoring unsupported character '' Kconfig:10:warning: ignoring unsupported character '' Kconfig:10:warning: ignoring unsupported character '' Kconfig:13:warning: ignoring unsupported character '' arch/Kconfig:1:warning: ignoring unsupported character '' arch/Kconfig:2:warning: ignoring unsupported character '' arch/Kconfig:2:warning: ignoring unsupported character '' arch/Kconfig:4:warning: ignoring unsupported character '' ... After several rounds of experiments, it turns out this is caused by line endings. Historically, Linux and macOS used linefeed (LF) characters while Windows used a carriage return plus a linefeed (CRLF). When Azure Pipelines checks out the U-Boot repo, Git tries to compensate for the difference by automatically making lines end in CRLF in the working directory on Windows, which confuses the Kconfig file parsing logic. Fortunately Git provides a way for repos to tell Git not to do such automatical line endings conversion via .gitattributes file below: * text eol=lf Signed-off-by: Bin Meng --- Changes in v2: - new patch: Add .gitattributes for line endings .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8560b79 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Declare files that always have LF line endings on checkout +* text eol=lf -- 2.7.4