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

[24.05] .gitignore: ignore .direnv #326663

Merged

Conversation

ShamrockLee
Copy link
Contributor

@ShamrockLee ShamrockLee commented Jul 12, 2024

Description of changes

Add a rule to .gitignore to exclude .direnv, the name of the temporary directory created by direnv, from the source tree.

#322650 is introduced to the "master" branch, invoking an official .envrc direnv configuration when a developer enters the Nixpkgs source directory.

When checking out the stable-release branches, the rule to exclude the temporary directory .direnv got lost from .gitignore, and the temporary directory became visible to source control, creating a risk of polluting the source tree.

This patch backports the .gitignore rule against .direnv to the stable release branch and eliminates such risk of pollution.

Even though the necessity of .envrc inside the source tree is under debate, the opinions from both sides support the non-negligible use of direct as a developer tool by Nixpkgs contributors, and it would be beneficial to have a .gitignore rule to exclude the corresponding temporary files whether we have an official .envrc or not.

Partially backport #322650

Cc: @infinisil @toastal

Things done

  • Built on platform(s)
    • x86_64-linux (No rebuild)
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Add a rule to .gitignore to exclude .direnv, the name of the temporary
directory created by direnv, from the source tree.

Commit f0160ba (".envrc: init for new shell.nix") is introduced to
the "master" branch, invoking an official .envrc direnv configuration
when a developer enters the Nixpkgs source directory.

When checking out the stable-release branches, the rule to exclude the
temporary directory .direnv got lost from .gitignore, and the temporary
directory became visible to source control, creating a risk of polluting
the source tree.

This patch backports the .gitignore rule against .direnv to the stable
release branch and eliminates such risk of pollution.

Even though the necessity of .envrc inside the source tree is under
debate, the opinions from both sides support the non-negligible use of
direct as a developer tool by Nixpkgs contributors, and it would be
beneficial to have a .gitignore rule to exclude the corresponding
temporary files whether we have an official .envrc or not.

Partially backport f0160ba
@ShamrockLee ShamrockLee changed the title [release-24.05] .gitignore: ignore .direnv [24.05] .gitignore: ignore .direnv Jul 12, 2024
@drupol drupol merged commit 36660ac into NixOS:release-24.05 Jul 16, 2024
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants