gregsexton / gitv

gitk for Vim.
936 stars 59 forks source link

Browser mode displays the wrong repo for new git submodules #40

Closed idbrii closed 11 years ago

idbrii commented 12 years ago

If I try to use browser mode (:Gitv) from a submodule, it displays the parent repo's history. If I use file mode (:Gitv!), it correctly displays the history for the current file. Using :GStatus in the submodule works correctly. I'm using Ubuntu 12.04.

Repro script:

echo Create remote for submodule
mkdir test_remote
cd test_remote
git init
echo first > file
git add file
git ci -m'initial'
cd -

echo Create local
mkdir test_local
cd test_local
git init
echo first > file
git add file
git ci -m'initial'

git submodule add ../test_remote remote
cd remote
echo modify remote >> file
git ci -am'submodule change'
gvim file +Gitv
cd -

The .git file for the submodule is just a text file with the actual location of the .git repo:

$ cat /tmp/tester/test_local/remote/.git 
gitdir: /tmp/tester/test_local/.git/modules/remote

Versions:

$ git --version
git version 1.7.9.5

$ cd ~/.vim/bundle/gitv/ ; git log --oneline -1
582e32b Handle a commit having "[" in the message when yanking the sha.

$ cd ../fugitive ; git log --oneline -1
b0c74e2 Support localized `git status`
gregsexton commented 12 years ago

Thanks for submitting this and thanks for the helpful problem description. I'm not sure what's causing the problem off the top of my head but will look into it.

idbrii commented 11 years ago

Caused by tpope/vim-fugitive/issues/309.