Skip to content

Fix #198 - make GIT's safe.directory '*' by default on repository fetch #200

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

Merged
merged 1 commit into from
Jul 26, 2022

Conversation

Ocramius
Copy link
Member

This is an ugly side-effect, and it will modify the environment of users that rely on this package
outside the context of the delivered docker container, but it is a good workaround for the security
and compatibility mess that GIT 2.35.3 introduced.

In fact, this application was never meant to run in multi-user mode, and the container it runs will
not be affected by side effects (mostly git hooks) in freshly checked out code.

Ref: https://stackoverflow.com/a/71904131/347063
Ref: https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory
Ref: https://marc.info/?l=git&m=164989570902912&w=2
Ref: git/git@8959555
Ref: git-for-windows/git#3809 (comment)

… fetch

This is an ugly side-effect, and it will modify the environment of users that rely on this package
outside the context of the delivered docker container, but it is a good workaround for the security
and compatibility mess that GIT 2.35.3 introduced.

In fact, this application was never meant to run in multi-user mode, and the container it runs will
not be affected by side effects (mostly git hooks) in freshly checked out code.

Ref: https://stackoverflow.com/a/71904131/347063
Ref: https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory
Ref: https://marc.info/?l=git&m=164989570902912&w=2
Ref: git/git@8959555
Ref: git-for-windows/git#3809 (comment)
@Ocramius Ocramius added the Bug Something isn't working label Jul 26, 2022
@Ocramius Ocramius added this to the 1.14.0 milestone Jul 26, 2022
Copy link
Member

@boesing boesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
The test looks a bit weird as it supposed to be an integration test since you are validating that the command was executed but I don't want to be too picky here.

@Ocramius Ocramius self-assigned this Jul 26, 2022
@Ocramius Ocramius merged commit 22eed25 into 1.14.x Jul 26, 2022
@Ocramius Ocramius deleted the fix/#198-allow-git-operations-on-any-directory branch July 26, 2022 16:41
@Ocramius
Copy link
Member Author

🚢

Trying out a release ASAP.

@Ocramius Ocramius linked an issue Jul 26, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

git broken on latest 1.14.0 image
2 participants