Shougo / dein.vim

:zap: Dark powered Vim/Neovim plugin manager
MIT License
3.43k stars 198 forks source link

A plugin sometimes doesn't update with `dein#check_update()` #384

Closed hexium310 closed 4 years ago

hexium310 commented 4 years ago

Problems summary

When the command that updates the timestamp of .git (e.g. git reset --hard HEAD~) was run in a plugin directory, a plugin sometimes doesn't update with dein#check_update(). This issue occur when the timestamp of .git after running command is newer than pushedAt of its repository.

Expected

Environment Information (Required!)

Provide a minimal .vimrc with less than 50 lines (Required!)

" Your minimal .vimrc
const s:dein_dir = expand('$XDG_CACHE_HOME/dein')
const s:dein_core_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'

if isdirectory(s:dein_core_dir)
  let &runtimepath .= ',' . s:dein_core_dir
  let g:dein#install_github_api_token = '***'

  if dein#load_state(s:dein_dir)
    call dein#begin(s:dein_dir)

    call dein#add('Shougo/dein.vim')
    call dein#add('vim-jp/syntax-vim-ex')

    if dein#check_install()
      call dein#install()
    endif

    call dein#end()
    call dein#save_state()
  endif
endif

The reproduce ways from Vim starting (Required!)

  1. :call dein#update()
  2. $ cd $XDG_CACHE_HOME/dein/repos/github.com/vim-jp/syntax-vim-ex
    $ git reset --hard HEAD~
  3. :call dein#check_update(v:true)
Shougo commented 4 years ago

sorry. It is the feature. dein#check_update() is not perfect solution.

dein does not save the repository update time, so it uses .git directory timestamp.

If you have better implementation, please send the PR.

Shougo commented 4 years ago

Please test https://github.com/Shougo/dein.vim/pull/385 changes.

hexium310 commented 4 years ago

I checked that the plugins updated after git reset. Thank you.

Shougo commented 4 years ago

OK. Merged.