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

Keep git dir in git build context #815

Merged
merged 1 commit into from
Feb 26, 2021
Merged

Keep git dir in git build context #815

merged 1 commit into from
Feb 26, 2021

Conversation

vladaionescu
Copy link
Member

Let me know if you can think of any downsides if we do this.

Fixes #813

@alexcb
Copy link
Collaborator

alexcb commented Feb 26, 2021

I could see this backfiring for users who structure their build in a way that depends on .git, only to discover if they distributed a source-code release as a .tar.gz, the building out of that source code will fail since the .git directory won't exist.

By allowing the .git to be copied into the build we'll ultimately giving the power to the user to decide weather or not the .git contents should be referenced or not.

Perhaps a different solution would be to allow a --strict mode which skips the .git contents from being included. That would make it problematic for users to issue commands like git rev-parse HEAD and would force them to use the earthly env variables instead. That could work for their own build scripts, but what if they wanted to use a vendored tool which required a .git; it seems like a lot to ask users to ditch those tools in favour of (re)writing them to use our env variables (vendor lockin).

Ultimately I think it's fine to include the .git even under the --strict mode.

@vladaionescu vladaionescu merged commit bded103 into main Feb 26, 2021
@vladaionescu vladaionescu deleted the vlad/keep-git branch February 26, 2021 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different behavior from local and remote targets
2 participants