RFR: 8267892: Add .gitattributes to repo
Ambarish Rapte
arapte at openjdk.java.net
Fri May 28 06:41:08 UTC 2021
On Thu, 27 May 2021 22:14:51 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
> This fix adds a `.gitattributes` file to prevent git from replacing line endings if the global `.gitconfig` file on the client system is configured with core.autocrlf = true (which it is by default when using the native Git for Windows).
>
> This can cause build or test problems with scripts or other files that expect Unix-style line endings. For two recent examples of such problems, see [JDK-8267694](https://bugs.openjdk.java.net/browse/JDK-8267694) and [this comment in PR #518](https://github.com/openjdk/jfx/pull/518#issuecomment-849966053).
>
> To test this, I set `core.autocrlf = true` in my `$HOME/.gitconfig` and cloned the master branch of the jfx repo into a new local repo. The files all had CRLF line endings. I then cloned the branch with the fix for this PR into a new repo and verified that the line endings are correctly left alone (LF line endings).
>
> As a second test, here is a failing GHA build of the patch from PR #518 that fails as expected due to this bug:
>
> https://github.com/kevinrushforth/jfx/actions/runs/883603338
>
> Here is a GHA build of that same branch, plus the commit to add `.gitattributes`:
>
> https://github.com/kevinrushforth/jfx/actions/runs/883620592
Looks good to me.
Git documentation which explains the usage : https://git-scm.com/docs/gitattributes#_text
-------------
Marked as reviewed by arapte (Reviewer).
PR: https://git.openjdk.java.net/jfx/pull/523
More information about the openjfx-dev
mailing list