pombreda / vcscommand

Automatically exported from code.google.com/p/vcscommand
0 stars 0 forks source link

VCSVimDiff between two arbitrary commits fails in git #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install vcscommand versioned 'beta22'
2. open git controlled file
3. Do a :VCSVimDiff <commit1> <commit2>

What is the expected output? What do you see instead?

Instead of the expected vimdiff between the two commits, you see:
VCSCommand:  Vim(cd):E344: Can't find directory "git review e8c2fcce ..."
in cdpath

What version of the product are you using? On what operating system?

VCSCommand 'beta22', Vim 7.0, Linux.

Please provide any additional information below.

Here's my fix:

$ diff -u vcsgit.vim vcsgit.vim.orig 
--- vcsgit.vim  2008-05-02 16:46:02.425417000 +1000
+++ vcsgit.vim.orig     2008-05-02 16:46:41.607075000 +1000
@@ -221,7 +221,7 @@
                let revision = a:argList[0]
        endif

-       let oldCwd =
VCSCommandChangeToCurrentFileDir(resolve(bufname(VCSCommandGetOriginalBuffer(buf
nr('%')))))
+       let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname('%')))
        try
                let prefix =
system(VCSCommandGetOption('VCSCommandGitExec', 'git') . ' rev-parse
--show-prefix')
        finally

Original issue reported on code.google.com by dil....@gmail.com on 2 May 2008 at 6:54

GoogleCodeExporter commented 9 years ago
Could you please provide your settings related to the 'cdpath' error?  I am not 
able
to replicate this issue.

Original comment by bob.hies...@gmail.com on 2 May 2008 at 1:31

GoogleCodeExporter commented 9 years ago
Ahh, just found out, you have to be on different directory to the file being 
opened
to reproduce my 'cdpath' error.
eg.

$ cd git/repo1/dir1/
$ vim file1.txt
(:VCSVimDiff <commit1> <commit2>) works
$ cd ..
$ vim dir1/file1.txt
(:VCSVimDiff <commit1> <commit2>) FAILs giving the 'cdpath' error

Original comment by dil....@gmail.com on 3 May 2008 at 2:17

GoogleCodeExporter commented 9 years ago
Please try beta24:  http://vcscommand.googlecode.com/files/vcscommand-beta24.zip

It may fix this issue.  If it does not, please provide your 'cdpath' settings, 
as
well as any other settings related to changing directory automatically.

Original comment by bob.hies...@gmail.com on 20 May 2008 at 6:47

GoogleCodeExporter commented 9 years ago
I have (inadvertently) replicated the problem.

Original comment by bob.hies...@gmail.com on 3 Jun 2008 at 3:08

GoogleCodeExporter commented 9 years ago
This is fixed in beta25.

The issue was that the git VCSReview failed when invoked from a VCS result 
buffer. 
VCSVimDiff, when invoked with 2 arguments uses VCSReview twice, so the second 
call
(invoked from the first result buffer) failed.

This was fixed by changing directory using the path from the original buffer 
instead
of the result buffer.

Original comment by bob.hies...@gmail.com on 3 Jun 2008 at 4:38

GoogleCodeExporter commented 9 years ago
I assume this is fixed, barring further input.

Original comment by bob.hies...@gmail.com on 16 Sep 2008 at 8:51