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

Wildcard tag doesn't play well with :PlugUpdate when tags are detached ones. #719

Open
3 of 11 tasks
autozimu opened this issue Jan 5, 2018 · 3 comments
Open
3 of 11 tasks

Comments

@autozimu
Copy link

autozimu commented Jan 5, 2018

(I was under the impression that this plugin supports wildcard tag releases properly, so correct me if I am wrong.)

:PlugUpdate seems won't fetch latest tags when the plugin has property of wildcard tag.

With this minimal vimrc

call plug#begin('~/.vim/plugged')
Plug 'autozimu/plug-wildcard', {'tag': 'release-*'}
call plug#end()
  1. Run :PlugInstall. This will install the plugin properly.
  2. Make a newer release in the repo, say release-0.2. The tag is slightly irregular. It works like this
# make changes
git commit -m 'new release'
git push --tags

(Note at this point, only tags are pushed. Current branch HEAD is not pushed.)
3. Run :PlugUpdate.

At this point, the plugin is not updated, while it is expected to update to release-0.2.

(This affects autozimu/LanguageClient-neovim#239)


Neovim version

NVIM v0.2.2
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -Wconversion -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector --param ssp-buffer-size=4 -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/opt/neovim/build/config -I/opt/neovim/src -I/opt/neovim/.deps/usr/include -I/opt/neovim/.deps/usr/include -I/opt/neovim/.deps/usr/include -I/opt/neovim/.deps/usr/include -I/opt/neovim/.deps/usr/include -I/opt/neovim/.deps/usr/include -I/nix/store/s96g9b8rl9ab13v1by7n661h0hzpbgsw-glibc-2.25-49-dev/include -I/opt/neovim/build/src/nvim/auto -I/opt/neovim/build/include

Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info
  • Type:
    • Bug
    • Enhancement
    • Feature Request
    • Question
  • OS:
    • All/Other
    • Linux
    • OS X
    • Windows
  • Vim:
    • Terminal Vim
    • GVim
    • Neovim

Edit: only detached tags can reproduce this issue.

@autozimu autozimu changed the title Wildcard tag doesn't play well with :PlugUpdate Wildcard tag doesn't play well with :PlugUpdate when tags are detached ones. Jan 5, 2018
@autozimu
Copy link
Author

autozimu commented Jan 5, 2018

Looks like it is due to default git fetch behaviour.

Quote from git doc,

By default, any tag that points into the histories being fetched is also fetched; the effect is to fetch tags that point at branches that you are interested in. This default behavior can be changed by using the --tags or --no-tags options or by configuring remote..tagOpt. By using a refspec that fetches tags explicitly, you can fetch tags that do not point into branches you are interested in as well.

@autozimu
Copy link
Author

autozimu commented Jan 5, 2018

Another related issue is that when using tag spec, it clones whole repo instead of a shadow clone.

vim-plug/plug.vim

Line 1342 in 96375cb

\ has_tag ? '' : s:clone_opt,

In use cases of https://github.com/autozimu/LanguageClient-neovim/tags, the whole purpose of using differnt tags for different binary distributions is to reduce users's initial download size.

@junegunn
Copy link
Owner

junegunn commented Jan 6, 2018

Thanks for the report. Looks like the method vim-plug internally uses does not work with "detached" tags. And the reason vim-plug does not perform shallow clone when tag is specified is to make it possible to switch to any tag in the history. The option was introduced to allow users to pick a stable release they want rather than to reduce the amount of data transfer, so I'd say this is working as intended.

I'm currently not committed to looking for a solution since I don't use any plugin that has the issue, and I don't have free time to work on this at the moment.

Patches are welcome, given that they don't make the code much more complex. Thanks.

autozimu added a commit to autozimu/vim-plug that referenced this issue Jan 6, 2018
autozimu added a commit to autozimu/vim-plug that referenced this issue Mar 4, 2018
janlazo pushed a commit that referenced this issue Oct 30, 2019
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

2 participants