Skip to content
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

failed to checkout specific commit of plugin #151

Closed
howarddo2208 opened this issue May 14, 2023 · 3 comments · Fixed by #153
Closed

failed to checkout specific commit of plugin #151

howarddo2208 opened this issue May 14, 2023 · 3 comments · Fixed by #153

Comments

@howarddo2208
Copy link

Describe the bug

I tried the instructions of README for installing specific commit, but ultimately failed. I even tried to the full SHA but still doesn't work

Steps to reproduce

example: install v0.5 of this plugin zsh-nix-shell

# ~/.config/zsh/.zshrc
plug "chisui/zsh-nix-shell" "4eb69b0"

Expected behavior

install normally

Screenshots and recordings

image

OS / Linux distribution

Linux EndeavourOS

Zsh version

5.9

Zap version

Version: release-v1/1.1.3

Terminal emulator

Wezterm

If using WSL on Windows, which version of WSL

None

Additional context

No response

@AntPeixe
Copy link
Contributor

AntPeixe commented May 14, 2023

I think this is caused by the fact that the cloning/install of the plugin is done with depth 1.

So the commit you are targeting is older and can't be switched to.

I'd suggest that the clone doesn't use depth if a commit hash is passed (edit: or unshallow afterwards if needed)

AntPeixe added a commit to AntPeixe/zap that referenced this issue May 14, 2023
mamaraddio pushed a commit that referenced this issue May 15, 2023
* fix: unshallow clone for plugin checkout

fixes #151

* refactor: address PR comments
mamaraddio added a commit that referenced this issue May 15, 2023
* docs: make it more obvious the image is a video link

* feat: update README (#150)

* feat: update README

* fix: update README with the new video thumbnail

* fix: update README with updated uninstall text

* fix: unshallow clone for plugin checkout (#153)

* fix: unshallow clone for plugin checkout

fixes #151

* refactor: address PR comments

---------

Co-authored-by: Matthew Winter <33818+wintermi@users.noreply.github.com>
Co-authored-by: Christian Chiarulli <chris.machine@pm.me>
Co-authored-by: António Peixe <antonio.icr.peixe@gmail.com>
@howarddo2208
Copy link
Author

Thanks for the quick update @AntPeixe, here's the output of zap update now. Is Diverged state an ok state?
image

@AntPeixe
Copy link
Contributor

AntPeixe commented May 15, 2023

By checking out a commit in particular the state of the local clone becomes a detached head. It should match the exact commit you select.

Also it actually wouldn't make sense to update that plugin if you specified the commit.

In terms of functionality it should all be good. However, if you find anything please open another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants