-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add option for shallow clones #2
Comments
In regards to freezing versions into a version lockfile, do you know of a way for shallow clones to clone at a depth needed for a particular git revision (i.e. the revision specified in the lockfile)? Because if not, shallow clones would not work with freezing, right? |
Good point. I guess we would have to do something like clone with a default depth (say, 100) and then if the ref doesn't exist, fetch the rest of the history. It is possible to fetch a specific commit, but unfortunately that doesn't work with all server configurations (and, in particular, it doesn't work with GitHub):
|
I found that since git version 2.11, git clone has a This sounds too good to be true though so I'm probably wrong, but I can't test this at the moment... but I still wanted to mention it now. 😉 |
Actually I just tried this and it seems to work! 🎉 Edit: For future reference in case I forget, the |
That is pretty sweet. 👍 It'll make the lockfiles a little ugly and harder to hand-edit so I'll make this an opt-in option. |
Sometimes shallow cloning using However, it seems to reliably shallow clone if I just subtract 1 day from the date of the commit/tag, which I feel like is an acceptable trade off. If we do this, a time/date library would be needed and thankfully emacs seems to have one, linking here for future reference: https://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Calculations.html#Time-Calculations. I'm not sure how |
It might honestly be better to just do #149 instead, since it'll have mostly the same effect for UX: you're acquiring the package in some nonstandard way for speed, but then when it's time to do actual development you probably want to convert it to a normal repository. (The reason being that shallow clones are full of caveats, as you've observed, whereas I pretty much already know how to implement #149.) |
The size of the EmacsMirror git repo
Shallow clone reduces the size quite a lot (311M -> 26M)
And I think there is no point to keep the whole history of this repo, maybe it is a good idea to shallow clone this repo. |
As someone who has their OS on a small partition, I would quite like this feature. There's not much point in storing all of the history on disk (by default), especially for things that I know I won't want to do anything with, such as epkgs or Melpa. |
This option is applied only for packages without version lock. Merges #372.
Rip. GitHub didn't pick up that that PR "partially" closes this issue :P |
This option is applied only for packages without version lock. Merges radian-software#372.
GitHub must have added the ability to fetch an unadvertised ref at some point, because it sure seems to work now when it didn't before. We take advantage in straight.el.
GitHub must have added the ability to fetch an unadvertised ref at some point, because it sure seems to work now when it didn't before. We take advantage in straight.el.
Cloning Git repos can take a while. It would be nice to offer a config option to clone repositories shallowly by default.
The text was updated successfully, but these errors were encountered: