fix: gitattributes enforcing line endings#5381
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5381 +/- ##
=======================================
Coverage 59.73% 59.73%
=======================================
Files 345 345
Lines 23394 23394
=======================================
Hits 13974 13974
Misses 8450 8450
Partials 970 970 |
73c577f to
39e0206
Compare
39e0206 to
55bd01d
Compare
|
I've updated this PR to be opt-in to only certain files and the |
|
Changes LGTM. Can I have an ETA, please? We are blocked due to this issue. Thanks. |
c6ac6df to
c15f6f1
Compare
Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
c15f6f1 to
4a6ab2b
Compare
|
Hi, I don't see the changes in the master branch. https://github.com/docker/cli/blob/master/.gitattributes. |
|
Could you please share ETA? |
|
Still see cli/command/container/testdata/utf8.env file modified after git clone on Linux machine. -bash-4.2$ git status modified: cli/command/container/testdata/utf8.env |
|
@mbhadale what is your git config values for |
|
Seems like this file was maybe committed with ⋊> ~/G/cli on master ◦ file cli/command/container/testdata/utf8.env 09:30:18
cli/command/container/testdata/utf8.env: Unicode text, UTF-8 (with BOM) text, with CRLF line terminators
⋊> ~/G/cli on master ◦ git log -p -- file cli/command/container/testdata/utf8.env 09:30:25
commit 1630fc40f8f9f665a7292838b755520b1fefe307
Merge: 130222870 e5b7b7e87
Author: Daniel Nephin <dnephin@docker.com>
Date: Mon Apr 17 17:40:59 2017 -0400
Import docker/docker/cli
Signed-off-by: Daniel Nephin <dnephin@gmail.com> |
|
Looks like those fixtures were added to test issues on Windows, so it's likely they were indeed CRLF on purpose; original commit that added them was in moby/moby; moby/moby@01d3a16
|
|
This is what I get. -bash-4.2$ git config --list
push.default=simple
url.git@gitlab.eng.vmware.com:.insteadof=https://gitlab.eng.vmware.com/
core.autocrlf=input
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=git@gitlab.eng.vmware.com:core-build/mirrors_github_docker_cli.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master |
$ git config --global core.autocrlf inputhttps://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration This might be converting the |
|
Still seeing this issue with core.autocrlf=false. -bash-4.2$ git config --list |
|
This is a bit difficult to debug since I cannot reproduce this on my Linux machine 🙈 Also re-read this section of the Git book
Seems like this wouldn't do anything on checkout and only on commit. |
|
I still see the issue, I tried setting git config core.eol crlf as mentioned in the testing section of the issue. As per this #5381 (comment) file has CRLF ending. I think we should remove * text=auto and specify files manually if they want git to handle line endings. utf8.env -text Let me know what you think. |
I'm not so sure. I still cannot reproduce what you are seeing, nor can any of my colleagues. Tested on Linux and Windows. We don't enforce a particular line ending on checkout with
The only enforcement that is overriding your git config is for the The In the issue you mention "This issue is observed as intermittent but the frequency of failure is high.". So it's not a consistent thing? It only happens now and again? You also mention there is a mirror branch " We can not fix this in our mirror branch"? Maybe the original |
fixes #5377
- What I did
Switch to an opt-in approach to forcing the
lfline ending to certain files and directories.- How I did it
Change the first line
* text=auto eol=lfto not enforce line endings and instead only force thescripts/directory to uselfline endings. Also add future support for.batfiles in-case we add them and also enforce.shfiles withlfline endings.- How to verify it
Checkout the branch after setting
git config core.autocrlf trueon a windows machine. On linux we can also enforce the line endings withgit config core.eol crlfand use that as a test. There shouldn't be any files marked by git as changed.- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)