-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[New] Speedup process to install nvm from git by dropping commit history #1476
Conversation
I really dislike the Is this incorrect? |
Nope, that's wrong, you can use |
What happens if I have a preexisting repository, and we do a fetch of depth 1 - what happens to the, say, 50 commits in between? |
@ljharb before you did a |
ok so you're saying that with |
not really, it's about how git working, git fetch won't delete data IMO, it just fetch a reference point with certain history depth, and when the referenced commits not exist, it'll grab them, if it's already exist, they'll just be there. |
I've never used Let's say I have commits 1 through 50 locally, the remote has 150, and I do a fetch with |
@ljharb it works on both clone and fetch, if it have 50 last commits locally on a certain branch/tag and you fetch with To be more clear here, as we don't delete the old tags, the old versions won't be deleted by this change, the only difference is - if the user wants to see the log of a certain tagged version/commit, git will only show up the last commit in that version/tag, and this won't affect the user anything about nvm using, as most of the users are just users, they don't need to trace the nvm code history, if they need to have a development environment, and they found that the history will be needed(actually they don't even need the history to development nvm, I don't think everyone traces code), then they can clone a clean repo or we can help them unshallow the history, but anyway I don't think it's a common case, as you can see there are tons of users of nvm but only about 200 contributors and most of the contributors will have a few commits. |
btw, I tested it via a full installation, and it looks ... super light and fast now! Even on a slow computer! You can try it:
as the history are dropped, the |
Even on a fast enough computer, install into ramdisk (
|
So if I I think I understand that the original commits would be present but unreachable, and thus candidates for GC - and that |
The parent commit won't be there, unless it's just one of the tagged releases or you did a |
Gotcha. OK, so I think this is ready to go :-) but, I'm going to wait until a few days after the next release before merging, since this release is pretty big already. |
Personally I think we can save the disk space and bandwidth just from now, as it's not a big at all, won't make a big release that bigger, but it's up to you, I'm just waiting for the next release. |
aba5e75
to
b5985b1
Compare
@ljharb is there anything else I can do here? Thanks. |
If we can resolve the |
I think you mean another fixed issue? |
Okay, we're on the same page, as that's not caused by |
Speed up the installation and bandwidth and save almost 50% disk space in v0.33.1:
2304KB ./nvm-origin-install
1296KB ./nvm-new-install