-
-
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
builtins.gitLsFiles #2944
Comments
I wholeheartedly agree with everything @nomeata has said (and so do three other people, it seems). For the vast majority of packages, this is the most sensible solution for setting up If this feature is deemed desirable but lacks someone to implement it, I would volunteer for that. |
Wouldn't it be better to add a |
Mmh, a |
A |
Ping @hamishmack |
Fund! I just noticed that this has spread to Guess people like the semantics, would be nice to have support for |
For me, this has been/will be solved by the introduction of flakes, which cannot see untracked files by default. |
Hi Sebastian! Didn’t know you are also traveling in nix land :-) I guess if flakes have this feature somehow inside, even more the reason to also offer it somehow to “plain nix” maybe, until everything is a flake. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
I marked this as stale due to inactivity. → More info |
I imagine this could be achieved through
These goals seem achievable with a lazy |
So you are saying we can add a |
Something like that, yes. Not sure if you're asking to implement it? @edolstra did you plan to work on a The main benefit of a |
No, no urgent plans to dive into the C++ code, sorry :-). But I'll cheer for whoever does. |
Update: the upcoming Nix release reimplements
See also |
I started to use this file here:
This is essentially doing what this code fragment from
builtins.fetchGit
does:nix/src/libexpr/primops/fetchGit.cc
Lines 51 to 73 in fb0ad89
The main difference to using something like
builtsin.fetchGit
isgit fetch
/git archive
/tar
danceAnd JFTR, the main benefits over approaches that parse
.gitignore
, or regex-based whitelists, are:gperf.out
) which may be large, or have sensitive data that you don’t want to reach/nix/store
.git
yet, avoiding the case where a localnix-build
works, but not for your colleages, because you forgot to add source files.But obviously there is a hack here, with this import from derivation, and it would be much cleaner if there was a
builtins.gitLsFiles
that would take a path (which can be a subdirectory of the repository), runand return that as a list of strings. This would also allow useful things like combining it with further filters.
Since the code is essentially already there, as part of
builtins.fetchGit
, would it be feasible to expose it as a builtin?The text was updated successfully, but these errors were encountered: