-
Notifications
You must be signed in to change notification settings - Fork 842
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
unnecessary git clone when updating package commit sha #1620
Comments
Hmm, yeah, I'm surprised it doesn't already do it this way. Looks like it's naming the package's directory based on the SHA. Since we don't know the previous SHA, we'll need to change this naming schema in order to reuse the prior git repo. |
Makes it consistent with snapshot hashes, and potentially reduces windows MAX_PATH problems
Fixed on master! |
Re-opening this, because my change only fixed the case where the commit was already in the repo. To fix properly we'll need to use |
Oh, and could we also get some logging? Depending on repo size and internet connection the wait can be a surprising. |
About |
I think it also makes sense to use |
For |
I'm missing something - when you edit the |
I meant Summary is that it's too computationally intensive to allow fetching specific SHAs, as it requires determining if it's accessible via a ref. Skipping the reachability check is considered to be a potential security issue and it's a non-default repo option. We could have heuristics to determine if something looks like a tag, and do a shallow clone. Dunno if this complication is worth it. |
It doesn't, actually. I made some changes towards doing this, but currently it just deletes the old repo and reclones. At least changing things to use |
+ Better logging + Tweak error handling
This turns out to be tricky to get right! Downgrading to P3 |
Does it really ever remove the old repo? (Does stack ever remove anything? :-) My experience is that it basically expects an unlimited space and breaks in unexpected ways if someone manually tries to remove old things.) |
No, the old repo isn't removed, and yes that could build up garbage. Removing |
Steps to reproduce:
put this in some project's stack.yaml:
stack build
change commit to
c39704d5f008af42f5c3c2d5319476c7aa12e52d
stack build
againExpected results:
git remote update; git reset --hard
Actual results:
This means whenever I want to update the dep, the entire git repository is cloned over the network again. That's not very good. :-(
I may use git submodules as a workaround, but it's not nice.
The text was updated successfully, but these errors were encountered: