I have two git projects A and B.
If I first open a buffer A/xxx.py in project A, the git layer of SpaceVim does show the
correct commit history of project A if I press the shortcut [SPC]gv.
Then, I open another buffer located in project B, say B/zzz.py, and I switched to this buffer,
the git plugin shows still the commit log of project A instead of B.
OS: MacOs High Serria
vim version: -
neovim version: 0.3.0
SpaceVim version: 0.9.0-dev
SpaceVim to open a file under A, then open another file under B.the git plugin shows still the git log
what do you mean? which git plugin, and what is git log?
"the git plugin" : git layer that SpaceVim uses, which is tpope/fugitive.vim.
"the git log": I mean the git commit log of the current repos if I press [SPC]gv
not sure it's an issue of fugitive or SpaceVim because when I looked into the runtime log of SpaceVim, it can correctly recognize the new project root when switch buffer between different git projects
You should follow the issue template, and debug info is needed.
I can not reporoduce it.
Ah, thank you very much for your time.
Attached you find the gif on my computer that can reproduce the problem.
I can not understand your gif, instead of using SPC g v, you can simply use :pwd check the current dir of your vim. you start vim via vim README.md, so does that menas, current dir is a git porject?
I confirme this issue.
While :pwd display correctly the current dir, :GV command rely on variableb:git_dir that seems not to be updated with SpaceVim, while it is correctly updated when using the plugin alone.
Waiting for a fix, as a workaround I have commented few code on junegunn/gv.vim plugin to get it working:
diff --git a/plugin/gv.vim b/plugin/gv.vim
index 3b01401..429917d 100644
--- a/plugin/gv.vim
+++ b/plugin/gv.vim
@@ -211,10 +211,10 @@ function! s:setup(git_dir, git_origin)
endfunction
function! s:git_dir()
- if empty(get(b:, 'git_dir', ''))
+" if empty(get(b:, 'git_dir', ''))
return fugitive#extract_git_dir(expand('%:p'))
- endif
- return b:git_dir
+" endif
+" return b:git_dir
endfunction
function! s:scratch()
Thanks, I will try to fix it.
I can reproduce it when press SPC f v d, as my global config is in my dotfiles repo. but after pressing SPC f v d, b:git_dir still is spacevim dir.