Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore binary files from .gitattributes. #5377

Closed
mbhadale opened this issue Aug 28, 2024 · 7 comments · Fixed by #5381
Closed

Ignore binary files from .gitattributes. #5377

mbhadale opened this issue Aug 28, 2024 · 7 comments · Fixed by #5381

Comments

@mbhadale
Copy link

Description

git clone docker-cli shows a list of modified files on the master branch on Linux machine. It seems line encodings are being modified during checkout. Please ignore the binary files and fix the encoding rule for .env file in .gitattributes files.

-bash-4.2$ git branch

  • master

-bash-4.2$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

modified:   cli/command/container/testdata/utf8.env
modified:   cmd/docker/winresources/docker.ico
modified:   docs/extend/images/authz_additional_info.png
modified:   docs/extend/images/authz_allow.png
modified:   docs/extend/images/authz_chunked.png
modified:   docs/extend/images/authz_connection_hijack.png
modified:   docs/extend/images/authz_deny.png

-bash-4.2$ git remote show origin

  • remote origin
    Fetch URL: https://github.com/docker/cli.git
    Push URL: https://github.com/docker/cli.git
    HEAD branch: master
    Remote branches:
    18.06 tracked
    18.09 tracked
    19.03 tracked
    20.10 tracked
    23.0 tracked
    24.0 tracked
    25.0 tracked
    26.0 tracked
    26.1 tracked
    27.x tracked
    dependabot/github_actions/actions/upload-artifact-4 tracked
    master tracked
    Local branch configured for 'git pull':
    master merges with remote master
    Local ref configured for 'git push':
    master pushes to master (up to

Reproduce

git clone https://github.com/docker/cli.git on a Linux machine.
git status

This issue is observed as intermittent but the frequency of failure is high.

Expected behavior

No modified files on master branch after git clone.

docker version

-bash-4.2$ docker version
Client:
 Version:         1.13.1
 API version:     1.26
 Package version: 
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

docker info

-bash-4.2$ docker info
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Additional Info

No response

@thaJeztah
Copy link
Member

Possibly related to this PR (maybe it's too eager, and also affecting pngs?);

cc @Benehiko PTAL

@mbhadale
Copy link
Author

Can this issue be fixed as soon as possible? We can not fix this in our mirror branch as the issue is in the master and sync will override the changes.

@thaJeztah
Copy link
Member

It's open source; contributions welcome as usual

@Benehiko
Copy link
Member

@mbhadale could you verify if this PR fixes it for you? #5381

@mbhadale
Copy link
Author

@Benehiko Thanks. This should fix binary files. What about this file which was modified:

cli/command/container/testdata/utf8.env

@mbhadale
Copy link
Author

mbhadale commented Sep 9, 2024

Still seeing cli/command/container/testdata/utf8.env file modified after git clone on linux machine.

-bash-4.2$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

modified:   cli/command/container/testdata/utf8.env

no changes added to commit (use "git add" and/or "git commit -a")

@Benehiko
Copy link
Member

Benehiko commented Sep 9, 2024

@mbhadale what is your git config values for git config get core.autocrlf and git config get core.eol and is this from a fork or from us? Do you see this only after cloning?

Seems like this file was maybe committed with CRLF line endings.

⋊> ~/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 <[email protected]>
Date:   Mon Apr 17 17:40:59 2017 -0400

    Import docker/docker/cli
    
    Signed-off-by: Daniel Nephin <[email protected]>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants