-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
use --depth=1 for git clone and git submodule update #23
base: master
Are you sure you want to change the base?
Conversation
@agkozak could you take a look? ) |
This is a very good idea, and your contribution is most welcome. Give me a few days to decide if there is anything else I'd like to add. Thanks! |
OK, your idea is fundamentally great. I will need to rewrite the code just a little bit to account for situations where the user is I will also probably add an option for a user such as myself to do a full clone of a plugin: when I'm working on one of my own plugins, I like to have the full history. I think I should have time this weekend to do what is necessary, and then I'll get your opinion, OK? |
ok, no problem ofc. doesn't matter how exactly it will be implemented, more important to improve zcomet in the end :) feel free to discard/reject/modify my pr in any way |
You'll get full credit. 😃 |
I realized, as I began to work on the code, that there was one complication. I had planned on using
So the logic I use now is this: do a shallow ( Go ahead and start using the code on my
|
i'd call such option something like regarding shallow clone of zcomet itself i think this should be just default in doc (i've already did it in my config) declare -r ZCOMET_HOME="$HOME/.zcomet"
if [[ ! -f "$ZCOMET_HOME/bin/zcomet.zsh" ]]; then
command git clone https://github.com/agkozak/zcomet.git --depth=1 "$ZCOMET_HOME/bin"
fi
...
zstyle ':zcomet:*' home-dir "$ZCOMET_HOME"
source "$ZCOMET_HOME/bin/zcomet.zsh" ps: btw when i was figuring out how to get zcomet to do what i wanted, my first thought was that zcomet would pass git opts as is, but that turned out not to be the case :( |
@agkozak any chances for the feature to be merged? :) i see your checklist but i think most users are just fine with reasonable defaults. eg as a user i don't see any benefits of full clone of plugin - specific commit would work just fine for such cases. fully documenting functions is also doesn't seem to be a blocker. the only thing left to be done imho is a shallow copy of the zcomet itself. thoughts? |
Don't worry -- I haven't forgotten this issue. I still need to do some research to make sure that I feel comfortable with our proposed solution. Interestingly, it looks as if Zinit has considered and rejected this approach; And I won't release it without a way of turning it off. I'm a plugin author, so I don't want to make it so that I can't use Thanks in advance for your continued patience and your encouragement. |
hi. i think there's no need to pull entire git plugin history as zcomet does not have any use of that (or did i miss something?). i got hit by this while migrating from another plugin manager (i like zcomet's simplicity 🙂), pretty annoying yet simple to fix.
so i simply add
--depth=1
opt for git here. it saves a lot on time and disk space for loading repos with large historyeg in my setup:
with the fix
you could say that prezto on its own is not so representative but here's example of widely (i hope so 🙂) used romkatv/powerlevel10k
many plugin managers widely use
--depth=1
too (eg example from zgenom i've used before https://github.com/jandamm/zgenom/blob/ebb37d1459e793af4a45fff8491286da37f7612d/functions/zgenom-clone#L80-L82)