-
Notifications
You must be signed in to change notification settings - Fork 169
Description
Problem
Plugins with the rev
indicator get an error on update:
You are not currently on a branch. Please specify which branch you want to merge with. See git-pull(1) for details.^@^@ git pull
The reason is that plugins with rev
are being checked-out as "detached" branches which are read-only, git-pull is not permitted on a detached branch.
Expect
I would expect to see no errors when updating my plugins.
Reproduce
Minimal .vimrc
:
if has('vim_starting')
set nocompatible
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
call neobundle#begin(expand('~/.vim/bundle'))
NeoBundleFetch 'Shougo/neobundle.vim'
NeoBundle 'pangloss/vim-javascript.git', { 'rev': '51a337b' }
NeoBundle 'groenewege/vim-less.git', { 'rev': '5d965c2' }
call neobundle#end()
filetype plugin indent on
NeoBundleCheck
- Open
vim
and let NeoBundle install plugins. - Run
:NeoBundleUpdate!
(force) to update plugins. - Run
:message
.
Notice the errors for plugins with the rev
indicator.
Ideas
I can think of some solutions:
Option A: Use real branch
When a plugin has a rev
, do not detach, checkout with a real branch e.g. git checkout -b rev 63f0392
Option B: Check current revision
Before pulling, if (a) plugin has rev
AND (b) already cloned, verify current revision and cancel pulling if current revision == rev
indicator.
Option C: Checkout master
Before pulling, if (a) plugin has rev
, AND (b) already cloned, checkout the local branch master
. (git checkout master
)
Hope this helps..
Activity
Shougo commentedon Sep 9, 2014
No. I tested it. But it will print errors.
I think it is better...
rafi commentedon Sep 10, 2014
Agree, option
B
would be the quickest and cleanest fix without over-complicating things now.Does anyone else have any thoughts on this? Calling out for opinions..
Shougo commentedon Sep 10, 2014
Fixed the problem by C.
petobens commentedon Mar 9, 2015
Mmm I'm having a similar problem. With the following minimal vimrc:
If I run
NeoBundleUpdate airline
I get an error saying:If i install
airline
like this:NeoBundle 'bling/vim-airline', {'rev' : 'master', 'name' : 'airline'}
the problem disappears. Why do I need to specify the branch?Shougo commentedon Mar 9, 2015
I think you checkouted the commit in the repository.
If you set 'rev', neobundle execute "git checkout master" automatically.
petobens commentedon Mar 10, 2015
@Shougo I don't know why this happened (I never checkouted a commit) but doing
git checkout master
fixes my problem. Sorry for the noise and thanks for the help.junkblocker commentedon Aug 7, 2015
I am having this problem with
YouCompleteMe
,UltiSnips
andSyntastic
. I do weekly updates and these three always run into this issue.