-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Nix.fetchGit
surprisingly uses export-ignore
git attribute
#7195
Comments
Nix.fetchGit
and export-ignore
attributeNix.fetchGit
surprisingly use export-ignore
git attribute
Nix.fetchGit
surprisingly use export-ignore
git attributeNix.fetchGit
surprisingly uses export-ignore
git attribute
Do you have a simple repro for that (or even a pointer to the bit of the code that does that)? From what I can see, we're using |
Yes, here is a script:
which returns for the nix command:
Interestingly, I just realized that if one makes the tree dirty, then
Results in:
Maybe some context might be useful. I use Nix in a continuous integration, thus from the reprository extracted by GitLab, I run Nix to build the project and some other components that are ignored when creating a build archive (for example manuals). Thus with this current behavior, since the manuals are ignored during export, they are not available for the CI targets that build the manuals. |
Yeah, been running into this issue too. It's standard in composer-land to export-ignore all the dotfiles and tests to keep the vendor directory smaller, but it causes my CI setup to fail since the tests don't get exported. But only when the git tree is clean... |
fetchGit currently uses So you can also enable submodules in the example for b to become available:
In my opinion, using |
Problem
The function
fetchGit
uses the.gitattributes
to determine whether some file should be included. Consequently, if a part of the repository is excluded (say for example that manuals are not packaged into the archive thatgit
must generate), then it is not checked out by Nix.I find this behavior really surprising, and I really hesitated to report it as a bug. Basically, when I ask for a git repository, I expect to get more or less the equivalent of a clone of the repository (or ref, or whatever that is related to git) and not the archive that would be generated from this repository. Is this behavior intended?
Checklist
Proposal
useExport
that would determine whether the attribute should be considered?git archive
, thus taking in account.gitattributes
" ?The text was updated successfully, but these errors were encountered: