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

chore: ignore .envrc #4994

Merged
merged 1 commit into from
Nov 10, 2022
Merged

chore: ignore .envrc #4994

merged 1 commit into from
Nov 10, 2022

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Nov 10, 2022

Our CONTRIBUTING page recommends setting the .envrc file to automatically enable the nix-shell.

This PR adds the .envrc to the .gitignore. I assume that not every developer uses nix-shell, but can use direnv, and in this case, the .envrc will be problematic.

@mtojek mtojek requested a review from a team November 10, 2022 09:59
@mtojek mtojek self-assigned this Nov 10, 2022
@mtojek mtojek requested a review from ghuntley November 10, 2022 10:00
@ghuntley
Copy link
Contributor

Over at #3790 (comment) discusses gitignoring it and the outcome was not to do it.

@mtojek
Copy link
Member Author

mtojek commented Nov 10, 2022

Thanks for bringing it up! I see that the following options have been considered:

  1. Tell git to ignore changes to .envrc or to never check out the file (after some research, doesn't seem possible)
  2. Tell direnv to source an alternative file

There is another option, but it isn't straightforward. We could commit the file to the repository, and then update the .gitignore, so that anyone can overwrite it locally and adjust it to their own needs, but won't overwrite the remote. I don't know what's the adoption of direnv and how many devs have their own custom .envrc (as @mafredri).

If we don't agree on marking .envrc as ignored, I can update our CONTRIBUTING docs with instructions to add the file to global .gitignore. I'm afraid that this file will start leaking to community pull-requests as people tend to git add --all.

@mafredri
Copy link
Member

Over at #3790 (comment) discusses gitignoring it and the outcome was not to do it.

@ghuntley I was probably unclear on that point. Adding to .gitignore is fine (and good even IMO). It was simply the case that having .envrc committed to the repo and added to .gitignore produces no additional benefit for the issue.

I probably would've raised a PR like this myself but .envrc is part of my personal .gitignore so I didn't notice. 😅

@mtojek
Copy link
Member Author

mtojek commented Nov 10, 2022

Ok, glad to see that we've an agreement, so I will merge it :)

@mtojek mtojek merged commit d64c73d into coder:main Nov 10, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants