You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
flakes: respect .ignore when excluding files copied to nix store #9996
Is your feature request related to a problem? Please describe.
Hi,
I'm switching to jj from git as my primary way of interacting with upstream git repos. (It's really good, i can't praise it enough). However, this causes some issues when I don't use a co-located git repo.
Nix decides that it's not a git repo (fair), and then proceeds to copy everything into the store, including otherwise .gitignore or .ignored files (unfortunate).
Besides this being bloaty/wasteful, this includes things like postgres state files, which are not able to be copied to the store.
Describe the solution you'd like
If a .ignore is present (maybe symlinked to .gitignore), nix will use that as an exclude filter when copying to the store.
Describe alternatives you've considered
Not much, I assume there's .hgignore support, or whatnot, this feels like an easy/safe win at first glance.
Reacted by 陈浩南, Viktor Palmkvist, Dirk, Li Goldragon, Anton Bulakh, Alejandro, Jay Kuroyanagi, Jean-Philippe Cugnet, Andrew Bastin, Matt Bryant and 2 more
I suppose an alternative approach would be to support jj natively, and call upon it to pack the repo for import. Not sure what's the best way to approach this.
For non-Git/Mercurial flakes, there is no filtering mechanism right now.
I wonder if we can use libgit2 for this, so we don't have to reimplement .gitignore parsing. git_ignore_path_is_ignored() almost does what we need but it requires a repository. We could create a temporary empty repo and copy the ignore file over...
Alternatively, for jj repos that use the git storage backend, it shouldn't be too hard to get libgit2 to handle them (since it's really just a Git worktree with the .git directory in a weird place).
Activity
colemickens commentedon Feb 12, 2024
I suppose an alternative approach would be to support
jjnatively, and call upon it to pack the repo for import. Not sure what's the best way to approach this.colemickens commentedon Feb 12, 2024
I guess I'm a bit befuddled, what are other people doing that use flakes without git?
edolstra commentedon Feb 14, 2024
For non-Git/Mercurial flakes, there is no filtering mechanism right now.
I wonder if we can use libgit2 for this, so we don't have to reimplement
.gitignoreparsing. git_ignore_path_is_ignored() almost does what we need but it requires a repository. We could create a temporary empty repo and copy the ignore file over...Alternatively, for jj repos that use the git storage backend, it shouldn't be too hard to get libgit2 to handle them (since it's really just a Git worktree with the .git directory in a weird place).