You are viewing a plain text version of this content. The canonical link for it is here.
Posted to builds@apache.org by Vladimir Sitnikov <si...@gmail.com> on 2019/07/18 06:27:46 UTC

INFRA-18763: Jenkins: Windows build agents vs git core.autocrlf

Hi,

Recently core.autocrlf setting set to input (was "true") for Windows hosts
(see INFRA-18383 and
https://github.com/apache/infrastructure-puppet/pull/1564 ).
That causes build disruptions especially for projects that expect that text
files should have "native" end-of-lines.

Typical recommendation for Windows is to configure "core.autocrlf=true".
For instance, here's GitHub's recommendation:
https://help.github.com/en/articles/configuring-git-to-handle-line-endings

I suggest:
a) Revert core.autocrlf to the Windows-default value (core.autocrlf=true)
b) Optionally provide diffrent flavours of Windows build agents. Then
"windows" label would pick "at random", thus projects could get coverage
for both settings.

I've raised https://issues.apache.org/jira/browse/INFRA-18763 to set
core.autocrlf=true.

Motivation:
0) GitHub recommends core.autocrlf=true
1) Windows editors default to CRLF line endings, so it is common for
Windows developers to produce CRLF files.
However the same text files look weird for other platforms, so it makes
sense to recognize that text files should have platform-native line endings.
It is exactly what core.autocrlf=true does for Windows (it converts to CRLF
on checkout and converts to LF when committing the files)
2) It is in line with SVN settings, and it is in line with what ASF
recommends for SVN: https://www.apache.org/dev/svn-eol-style.txt

Any thoughts?

Note: certain developers might want to specify "non-standard" configuration
(e.g. autocrlf=false on Windows), however I am sure builds.apache.org
should provide at least a build agent with a **default** Git configuration.

Vladimir

Re: INFRA-18763: Jenkins: Windows build agents vs git core.autocrlf

Posted by Vladimir Sitnikov <si...@gmail.com>.
Maxim>I would say it doesn't really matter what option is set on build
server

It does.
You can try with https://github.com/apache/jmeter
if you change core.autocrlf between input and true it would checkout text
files as LF or CRLF.

Maxim>I usually recommend to create per-repo .gitattributes file to avoid
different behavior

Thanks for the fast response.
However .gitattributes is NOT able to specify that. It is related, yet very
different.

Just in case:
.gitattributes allows to specify which files are "text" and which are
"binary"
.gitattributes allows to enforce line endings for certain files (e.g. it
could specify that *.bat should be converted to CRLF always)

However, .gitattributes can NOT enforce "platform-native" line endings.
You can specify "this file must be LF", you can specify "this file must be
CRLF", however you cannot specify that "this file must be LF in macOS and
CRLF in Windows".

It is core.autocrlf setting that makes Git to convert "text" files with
"unspecified eol" to CRLF in Windows.

Vladimir

Re: INFRA-18763: Jenkins: Windows build agents vs git core.autocrlf

Posted by Maxim Solodovnik <so...@gmail.com>.
I would say it doesn't really matter what option is set on build server
You can pass the build on build server, but fail on the build for
end-user with different option turned on
I usually recommend to create per-repo .gitattributes file to avoid
different behavior

On Thu, 18 Jul 2019 at 13:28, Vladimir Sitnikov
<si...@gmail.com> wrote:
>
> Hi,
>
> Recently core.autocrlf setting set to input (was "true") for Windows hosts
> (see INFRA-18383 and
> https://github.com/apache/infrastructure-puppet/pull/1564 ).
> That causes build disruptions especially for projects that expect that text
> files should have "native" end-of-lines.
>
> Typical recommendation for Windows is to configure "core.autocrlf=true".
> For instance, here's GitHub's recommendation:
> https://help.github.com/en/articles/configuring-git-to-handle-line-endings
>
> I suggest:
> a) Revert core.autocrlf to the Windows-default value (core.autocrlf=true)
> b) Optionally provide diffrent flavours of Windows build agents. Then
> "windows" label would pick "at random", thus projects could get coverage
> for both settings.
>
> I've raised https://issues.apache.org/jira/browse/INFRA-18763 to set
> core.autocrlf=true.
>
> Motivation:
> 0) GitHub recommends core.autocrlf=true
> 1) Windows editors default to CRLF line endings, so it is common for
> Windows developers to produce CRLF files.
> However the same text files look weird for other platforms, so it makes
> sense to recognize that text files should have platform-native line endings.
> It is exactly what core.autocrlf=true does for Windows (it converts to CRLF
> on checkout and converts to LF when committing the files)
> 2) It is in line with SVN settings, and it is in line with what ASF
> recommends for SVN: https://www.apache.org/dev/svn-eol-style.txt
>
> Any thoughts?
>
> Note: certain developers might want to specify "non-standard" configuration
> (e.g. autocrlf=false on Windows), however I am sure builds.apache.org
> should provide at least a build agent with a **default** Git configuration.
>
> Vladimir



-- 
WBR
Maxim aka solomax