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

pixi should manage its own .pixi/.gitignore #2115

Open
maresb opened this issue Sep 23, 2024 · 4 comments
Open

pixi should manage its own .pixi/.gitignore #2115

maresb opened this issue Sep 23, 2024 · 4 comments

Comments

@maresb
Copy link
Contributor

maresb commented Sep 23, 2024

Problem description

Currently the user (or pixi init) must add .pixi to their .gitignore to prevent Git from tracking .pixi/. There are two issues associated with this:

  1. It is a seemingly unnecessary additional installation step in light of the alternative below.
  2. Whenever the user checks out a branch from before .pixi was ignored, Git will stop ignoring .pixi.

Suggested alternative:

Have pixi create a .pixi/.gitignore file to ignore all files under .pixi/. This way the .pixi/ directory becomes self-contained and unobtrusive from the Git perspective. And this makes initialization of new pixi projects simpler. (IMO you could also get by without .gitattributes so then you're down to just pixi.toml!)

Bonus: repeat with .dockerignore

@maresb
Copy link
Contributor Author

maresb commented Sep 23, 2024

From #questions-chat

image

@maresb
Copy link
Contributor Author

maresb commented Sep 26, 2024

Another situation where the current state of things is annoying:

I'm working on some open-source project that doesn't use pixi, so I add my own pixi.toml. Ideally I could just leave that and the rest of the pixi files untracked by Git. However, I need to modify .gitignore and be careful not to check in the changes. I rebase quite frequently, so whenever I rebase I have to stash my updated .gitignore and that causes a big mess.

@maresb
Copy link
Contributor Author

maresb commented Sep 26, 2024

We might not yet be able to entirely get rid of .gitignore in the project root due to .egg-info, see #1693 (comment).

@maresb
Copy link
Contributor Author

maresb commented Sep 27, 2024

If we get rid of .gitignore in the project root, then we will trigger pypa/hatch#304. Probably the safest approach at first is to keep both .gitignores. We could also try and add .pixi to the built-in ignores as per pypa/hatch#493.

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

No branches or pull requests

1 participant