fetchTree: shallow git fetching by default#10028
Conversation
|
Team discussion:
|
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
7e4eea5 to
9cd889c
Compare
Done
This wouldn't make much sense here, as basically all code paths related to shallow cloning and caching are not triggered when a local git repository is fetched. Only for remote repos this test makes sense, but this would be hard to integrate with the functional tests, as it needs a git server which is not trivial to set up without nixos modules.
Yes, generally it is possible to have scenarios where the lack of incrementality of shallow fetching leads to more overall network traffic and disk I/O, like for example when fetching many different revisions of the same repo. Though it is worth mentioning that:
I believe for now, this is the better default, but thinking long term it might be better if the fetching strategy would be determined by nix automatically with possibility of overriding the behavior via |
Motivation: make git fetching more efficient for most repos by default
9cd889c to
358c26f
Compare
|
Generally I believe this is ready. @edolstra If I'm missing something that would allow me to add a meaningful functional test instead of the nixos tests, please let me know. Right know, I don't see a good way, as fetchTree doesn't return any attributes which would indicate if a repo was fetched shallowly or not (which is great BTW as it simplifies future upgrade paths). So the only way left to determine if a clone was shallow is looking at the cached git tree, but there is no cache when fetching a local repo. |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Motivation:
make git fetching more efficient for most repos by default