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

Some plug-ins fail to update if using setopt GLOB_DOTS #49

Open
xfzv opened this issue Mar 12, 2022 · 0 comments
Open

Some plug-ins fail to update if using setopt GLOB_DOTS #49

xfzv opened this issue Mar 12, 2022 · 0 comments

Comments

@xfzv
Copy link

xfzv commented Mar 12, 2022

Describe the bug

I'm not knowledgeable enough about Zsh and Git to understand why this occurs. For some reasons, using setopt GLOB_DOTS causes two of my plug-ins to fail to update with zpm u.

To Reproduce

  1. Use this .zshrc file:
if [[ ! -f ~/.zpm/zpm.zsh ]]; then
  git clone --recursive https://github.com/zpm-zsh/zpm ~/.zpm
fi
source ~/.zpm/zpm.zsh

# This seems to be the culprit. Commented for now, see explanations below.
# setopt GLOB_DOTS

zpm load zdharma-continuum/history-search-multi-word
zpm load zdharma-continuum/fast-syntax-highlighting
  1. Start a new Zsh instance:
Cloning into '/home/xfzv/.zpm'...
remote: Enumerating objects: 6364, done.
remote: Counting objects: 100% (408/408), done.
remote: Compressing objects: 100% (262/262), done.
remote: Total 6364 (delta 237), reused 261 (delta 118), pack-reused 5956
Receiving objects: 100% (6364/6364), 2.12 MiB | 13.66 MiB/s, done.
Resolving deltas: 100% (3958/3958), done.
Install zpm-zsh/helpers ✔
Install zdharma-continuum/history-search-multi-word ✔
Install zdharma-continuum/fast-syntax-highlighting ✔
  1. Run exec zsh
  2. Run zpm u:
Upgrade zpm-zsh/helpers ✔
Upgrade @zpm ✔
Upgrade zdharma-continuum/fast-syntax-highlighting ✔
Upgrade zdharma-continuum/history-search-multi-word ✔
# All plugins update just fine, including the last two
  1. Uncomment setopt GLOB_DOTS in .zshrc and save the modifications

  2. Open a new Zsh instance and run zpm clean (since we've made some changes, as per:

    zpm/README.md

    Line 456 in 06e2630

    By default zpm will generate cache file at first run, but if you will change `~/.zshrc` this cache should be removed using `zpm clean` command
    )

  3. A master.zwc file appears in both

    • ~/.zpm/plugins/zdharma-continuum---fast-syntax-highlighting/.git/refs/heads/
    • ~/.zpm/plugins/zdharma-continuum---history-search-multi-word/.git/refs/heads/
  4. Run zpm u:

Can't upgrade zdharma-continuum/fast-syntax-highlighting ✖
Upgrade @zpm ✔
Can't upgrade zdharma-continuum/history-search-multi-word ✖
Upgrade zpm-zsh/helpers ✔

Manually running git pull in both directories also fails:

cd zdharma-continuum---fast-syntax-highlighting
git pull
fatal: bad object refs/heads/master.zwc
error: https://github.com/zdharma-continuum/fast-syntax-highlighting did not send all necessary objects

cd zdharma-continuum---history-search-multi-word
git pull
fatal: bad object refs/heads/main.zwc
error: https://github.com/zdharma-continuum/history-search-multi-word did not send all necessary objects
  1. Run:
rm -rf ~/.zpm/plugins/zdharma-continuum---fast-syntax-highlighting/     \
       ~/.zpm/plugins/zdharma-continuum---history-search-multi-word/    \
       /tmp/zsh-1000/
  1. Comment setopt GLOB_DOTS in .zshrc and save the modifications.
  2. Open a new Zsh instance and repeat step 4 (run zpm u): both plugins update just fine.

Expected behavior

These two plug-ins are updated just like the others (possibly by avoiding main.zwc creation in both plug-ins repos?)

Additional context

No issue with the other Zsh plugins managers I've tried, the main.zwc file isn't created for any plug-in, including these two.

Hopefully you can reproduce.

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

No branches or pull requests

1 participant