Support exportIgnore on builtins.fetchGit #1192

Open
opened 2026-04-24 04:40:38 +00:00 by ratakor · 0 comments

When using builtins.fetchGit, the whole repository will be copied to the nix store even artifacts
ignored by gitattributes which can be expensive depending on the size of these artifacts or if the
repository is fetched a lot.

Describe the solution you'd like

Feature parity with nix's implementation of exportIgnore for builtins.fetchGit.
Although I think it would be better to default to false as prescribed by nix's documentation.
This isn't ideal but it's a way to declaratively ignore files that are tracked by git.

Describe alternatives you've considered

I haven't thought about a better alternative yet.

Additional context

I tried to implement it but I believe it would require to change how local dirty repositories are handled.

## Is your feature request related to a problem? Please describe. When using builtins.fetchGit, the whole repository will be copied to the nix store even artifacts ignored by gitattributes which can be expensive depending on the size of these artifacts or if the repository is fetched a lot. ## Describe the solution you'd like Feature parity with nix's implementation of exportIgnore for builtins.fetchGit. Although I think it would be better to default to false as prescribed by nix's documentation. This isn't ideal but it's a way to declaratively ignore files that are tracked by git. ## Describe alternatives you've considered I haven't thought about a better alternative yet. ## Additional context I tried to implement it but I believe it would require to change how local dirty repositories are handled.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1192
No description provided.