gregsexton / gitv

gitk for Vim.
936 stars 59 forks source link

Fix gitv for submodules #55

Closed idbrii closed 11 years ago

idbrii commented 11 years ago

Works around a fugitive bug: edit the HEAD-tree instead of the HEAD file. I think this is a better solution since it will avoid future file-path issues. (Assuming fugitive's pseudo files always work correctly.)

After I got that working, using 'u' didn't work (it loaded the root repo's history). It seems there was something wrong with the way gitv was calling git, but calling through to fugitive (instead of git) fixed it.

Now, instead of building our own git command, I'm calling through to fugitive#buffer().repo().git_command() (which correctly sets the git-dir). Since we're not calling git directly, I've removed g:Gitv_GitExecutable. The git executable can still be configured through g:fugitive_git_executable.

I've also replaced some other cases where we can get data from fugitive instead of trying to deduce it.

Tested on Ubuntu 12.04.2 and Gvim 7.3.429 with tpope/vim-fugitive/6462bdb.

idbrii commented 11 years ago

Works on Windows! Tested on Win7 x64 with GVim 32bit 7.3.46 w/ OLE.

gregsexton commented 11 years ago

Thank you for this! Looks good. I seem to remember having a lot of fun with this at the time. If I remember correctly, fugitive didn't open up quite as much of its internals for reuse.