vim-jp / vimdoc-ja

A project which translate Vim documents into Japanese.
https://vim-jp.org/vimdoc-ja/
329 stars 31 forks source link

Fails update vimdoc-ja(using lazy.nvim) #279

Closed mimikun closed 3 months ago

mimikun commented 7 months ago

Sometimes updating vimdoc-ja fails.

Failed (1)
  󰊠 vimdoc-ja  h (c)
      You have local changes in `/home/username/.local/share/nvim/site/lazy/vimdoc-ja`:
        * doc/tags-ja
      Please remove them to update.
      You can also press `x` to remove the plugin and then `I` to install it again.

I need to uninstall and reinstall again. It's very troublesome.

env

Windows

エディション  Windows 11 Pro
バージョン   22H2
インストール日 ‎2022/‎09/‎21
OS ビルド  22621.2500
エクスペリエンス    Windows Feature Experience Pack 1000.22677.1000.0

neovim

❯ nvim -V1 -v
NVIM v0.10.0-dev-bc850ba
Build type: RelWithDebInfo
LuaJIT 2.1.1697887905
Compilation: /usr/bin/gcc-10 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99
-Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_TS_HAS_SET_MAX_START_DEPTH -I/home/runner/work/neovim/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include -I/home/runner/work/neovim/neovim/build/cmake.config -I/home/runner/work/neovim/neovim/src

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/home/runner/work/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info
k-takata commented 7 months ago

Whether to include doc/tags-ja in the repository was discussed before: https://github.com/vim-jp/vimdoc-ja-working/issues/268

At that time, we decided to include it because Vim's help recommends to do so. But, this kind of issue has been reported several times: e.g. https://github.com/vim-jp/vimdoc-ja-working/issues/1206 We might need to reconsider it? (I hope plugin managers handle this correctly, though.)

mimikun commented 7 months ago

As far as I've researched, there are only a limited number of plugin managers that address this issue.

Is it possible to solve this by creating a branch (e.g. release) for installation with the plugin manager and setting it to ignore doc/tags-ja there?

Shougo commented 7 months ago

Both dein.vim and dpp.vim also don't have the problem.

h-east commented 7 months ago

All Vim plugin managers that run :helptags unconditionally have this problem. First of all, it is bad behavior for the plugin manager to unconditionally update the plugin's distribution file.

Vim plugin manager need to check the timestamp like minpac or add a judgment like this.

mimikun commented 7 months ago

Unfortunately, there are more "bad behavior" plugins than "good behavior" plugins.

good behavior plugins

bad behavior plugins

folke commented 7 months ago

The reason that plugin managers like lazy generate doc tags for installed/updated plugins, is that 99% of the plugins do not provide doc tags, or ship outdated doc tags.

vimdoc-ja is in the minority here.

It's also a bad idea to put doc/tags under version control, since they don't really seem to be idempotent.

I'm not planning to add any kind of exceptions for plugin managed doc tags to lazy.nvim

mimikun commented 3 months ago

I was able to avoid this issue by implementing a workaround based on https://github.com/delphinus/dotfiles/blob/master/.config/nvim/lua/core/lazy/init.lua.

https://github.com/mimikun/dotfiles/blob/b724b47d8ac92cf9098effdd6cbd60447baffc5e/dot_config/nvim/lua/plugins/vimdoc-ja.lua#L3-L21

Thank you!

h-east commented 3 months ago

@mimikun Hmm, I believe merging the PR below resolved this issue. https://github.com/vim-jp/vimdoc-ja-working/pull/1434

mimikun commented 3 months ago

Thank you. I'll try it once the changes from that commit are reflected in this repository.

h-east commented 3 months ago

It has already been reflected.