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
When using CPM_SOURCE_CACHE, each dependency is cloned in its own folder even if they are just different commits of the same repo. It seems to me that using git worktree would greatly optimize the download time and storage usage, by cloning a remote repo only once.
The behavior I would expect would be to have one folder in the cache per repo url, that contains a bare repo, then the usual hashed folders with worktrees created from this repo.
What do you think?
The text was updated successfully, but these errors were encountered:
Today I learned about git clone --reference-if-able, which may be a simpler alternative to worktrees in the context of CPM. It allows retrieving git objects from an existing local clone, to avoid downloading them from the remote server. clone times are dramatically reduced (like a factor of 10 or more, depending on your network). If you want to be safe you can add --dissociate to not borrow the objects from the local reference but copy them, which is a little longer but still saves a lot of time by avoiding some download.
I'm not sure what flexibility you have in CPM w.r.t. git commands but if you can inject custom arguments, and if you can easily find a previous clone of a repo in the CPM cache, then I think this optimization would be worth investigating.
When using
CPM_SOURCE_CACHE
, each dependency is cloned in its own folder even if they are just different commits of the same repo. It seems to me that usinggit worktree
would greatly optimize the download time and storage usage, by cloning a remote repo only once.The behavior I would expect would be to have one folder in the cache per repo url, that contains a bare repo, then the usual hashed folders with worktrees created from this repo.
What do you think?
The text was updated successfully, but these errors were encountered: