ramccor / vcscommand

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

1.99.43 breaks git integration (WinXP, msysgit, gVim 7.3) #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using:
* TortoiseGit 1.7.15.0 (msysgit version 1.8.0-preview20121022)
* Windows XP, SP3, English
* gvim
:version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 14 2012 13:24:15)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1-661
Compiled by digitectNO@SPAMdancingpaper.com
Huge version with GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent 
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
+conceal +cryptv
+cscope +cursorbind +cursorshape +dialog_con_gui +diff +digraphs -dnd -ebcdic 
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path 
+float +folding
-footer +gettext/dyn -hangul_input +iconv/dyn +insert_expand +jumplist +keymap 
+langmap +libcall +linebreak +lispindent +listcmds +localmap +lua/dyn +menu 
+mksession
+modify_fname +mouse +mouseshape +multi_byte_ime/dyn +multi_lang -mzscheme 
+netbeans_intg +ole +path_extra +perl/dyn +persistent_undo -postscript +printer 
+profile
+python/dyn -python3 +quickfix +reltime +rightleft -ruby +scrollbind +signs 
+smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary 
+tag_old_static
-tag_any_white -tcl -tgetent -termresponse +textobjects +title +toolbar 
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace 
+wildignore +wildmenu
 +windows +writebackup -xfontset -xim -xterm_save -xpm_w32

:VCSVimDiff in 1.99.42 works fine.
Using 1.99.43 and up (to 1.99.46) gives error message
"VCSCommand:  No suitable plugin"

I tried to add git to PATH for 1.99.46 but it did not help. Interestingly 
1.99.42 works OK even when git is not on path.

Original issue reported on code.google.com by richard....@gmail.com on 9 Apr 2013 at 2:50

GoogleCodeExporter commented 9 years ago
In 1.99.43, I removed the attempts to guess how to quote executable names, as 
various flavors of windows made that impossible to do consistently or 
correctly.  That means you'll need to set the path correctly for your system by 
setting VCSCommandGitExec to the appropriate value.

Having git in the PATH should be enough.  Could you please verify whether it 
is?  It certainly couldn't have worked in .42 without having git in the PATH, 
so it's possible you missed something.

Original comment by bob.hies...@gmail.com on 9 Apr 2013 at 3:20

GoogleCodeExporter commented 9 years ago
Well, it is embarrassing, but I found that I set VCSCommandGitExec in my _vimrc 
:). So one mystery is solved.
But it does not help in 1.99.46. Originally I had this line there:

let VCSCommandGitExec='C:\Program Files\Git\bin\git.exe'

which I changed now to more sophisticated:

if executable($ProgramFiles . '\Git\bin\git.exe')
    let g:VCSCommandGitExec= $ProgramFiles . '\Git\bin\git.exe'
endif

but the behavior is same. Works in 1.99.42 and fails in 1.99.43

Original comment by richard....@gmail.com on 9 Apr 2013 at 3:43

GoogleCodeExporter commented 9 years ago
What is the value of $ProgramFiles?

You may want to set it (for instance):

let g:VCSCommanditExec='c:\Program^ Files\Git\bin\git.exe'

The problem is that windows does fun things with quotes if they appear at the 
beginning of a command line, which is where they go when I (naively) quote the 
executable name.

I don't know if the ^ trick works with Windows XP.  Please let me know.

Original comment by bob.hies...@gmail.com on 9 Apr 2013 at 4:32

GoogleCodeExporter commented 9 years ago
Oops, that should be:

let g:VCSCommandGitExec='c:\Program^ Files\Git\bin\git.exe'

Original comment by bob.hies...@gmail.com on 9 Apr 2013 at 9:33

GoogleCodeExporter commented 9 years ago
$ProgramFiles == 'C:\Program Files'

Using the string with caret you propose breaks it also in 1.99.42 (1.99.46 
never works).

When it works in 1.99.42
g:VCSCommandGitExec == 'C:\Program Files\Git\bin\git.exe'

Original comment by richard....@gmail.com on 10 Apr 2013 at 4:11

GoogleCodeExporter commented 9 years ago
No string will work for .42 and later than .42, as the handling of that string 
changed.

Next thing to try:  please change the line in your vimrc to:

    let g:VCSCommandGitExec= '"' . $ProgramFiles . '\Git\bin\git.exe"'

While that handling caused problems previously, it might help your setup.

Original comment by bob.hies...@gmail.com on 10 Apr 2013 at 9:02

GoogleCodeExporter commented 9 years ago
Changing the assignment will give:

VCSCommandGitExec      "C:\Program Files\Git\bin\git.exe"

But this will not work neither in .42 nor in .43.

Probably I should clarify my previous reply, when I wrote
g:VCSCommandGitExec == 'C:\Program Files\Git\bin\git.exe'

The value, which works at least in .42, is precisely
:let g:VCSCommandGitExec
g:VCSCommandGitExec      C:\Program Files\Git\bin\git.exe
(i.e. now quotes)

Original comment by richard....@gmail.com on 11 Apr 2013 at 5:00

GoogleCodeExporter commented 9 years ago
Can you please capture the error that occurs with the new setting (that 
includes quotes)?

Original comment by bob.hies...@gmail.com on 11 Apr 2013 at 6:08

GoogleCodeExporter commented 9 years ago
Do you have a C:\Program Files\Git\cmd\git.exe as well?  What happens if you 
use it instead?

This is unfortunately hard for me to track down.  The simplest solution would 
be to ensure that git is on your path, because then you don't have to do 
anything, except remove the g:VCSCommandGitExec variable.

So far, I haven't been able to break msysGit on Windows 7, 32 bit.  I don't 
have an XP environment in which to test, though.

Original comment by bob.hies...@gmail.com on 11 Apr 2013 at 6:46

GoogleCodeExporter commented 9 years ago
I believe I see part of what is happening.  If you quote the value in 
g:VCSCommandGitExec, the plugin fails the check it runs (using executable()).  
If you don't quote, the command fails.

I have, temporarily at least, more or less reverted the change in .43 that 
disables quoting.  Please grab a copy at:

http://repo.or.cz/w/vcscommand.git/snapshot/7c95aa2c4597b6562ec82cb59154390f8db5
9c2f.zip

You should be able to use your original value of g:VCSCommandGitExec (the one 
that is NOT quoted).

Original comment by bob.hies...@gmail.com on 11 Apr 2013 at 7:42

GoogleCodeExporter commented 9 years ago
The commit:
http://repo.or.cz/w/vcscommand.git/snapshot/7c95aa2c4597b6562ec82cb59154390f8db5
9c2f.zip
fixes it for me. Thanks!

Coming to you previous questions, I have already tried to put git.exe in PATH, 
but it did not help. Otherwise git.exe works very well with cmd.exe, Git-bash 
or TortoiseGit, so I guess it is really some specific of vim / vcscommand.

Original comment by richard....@gmail.com on 12 Apr 2013 at 11:10

GoogleCodeExporter commented 9 years ago
I hate windows quoting rules.  I had removed the quoting in response to:

https://code.google.com/p/vcscommand/issues/detail?id=64&can=1

... but it seems that, since then, VIM has received a better default 'sxq' on 
windows that may fix the issue they were seeing.

While I am still fairly certain that your PATH isn't what you think it is, I'll 
put the quoting back in for executable names in the next release.  On the 
subject of PATH, did you verify from within VIM that the b:VCSCommandGitExec 
was NOT set, and that:

:!git <blah> 

worked?  If the variable is set, then the PATH is ignored (strictly speaking, 
that isn't true, as you could set the variable to a simple name with no slashes 
and then PATH would still be searched).

Original comment by bob.hies...@gmail.com on 12 Apr 2013 at 2:37

GoogleCodeExporter commented 9 years ago

Original comment by bob.hies...@gmail.com on 12 Apr 2013 at 2:58

GoogleCodeExporter commented 9 years ago
Commenting on #12:
I do not have normally "C:\Program Files\Git\bin" in my PATH. I wrote I put it 
there for the test if it helps with .46 but it did not. So I removed it.
So :!git for sure does not work.

If you suggest I have to set also my PATH in order to use the plugin then it is 
another matter. But then what should I set to  b:VCSCommandGitExec? (As it does 
not work with "correct" value.)

Original comment by richard....@gmail.com on 12 Apr 2013 at 3:06

GoogleCodeExporter commented 9 years ago
If you set the PATH, you should NOT set VCSCommandGitExec at all.  That 
variable is provided to help in two cases:

1. Your executable is named something other than 'git'.
2. Your executable is not in the PATH.

Original comment by bob.hies...@gmail.com on 12 Apr 2013 at 3:08

GoogleCodeExporter commented 9 years ago
Adding "C:\Program Files\Git\bin" to the PATH and removing VCSCommandGitExec 
fixes it even for .46. So I guess the problem only lies in handling of the 
VCSCommandGitExec variable.

I was confused when I changed the PATH, but left VCSCommandGitExec defined, 
which took precedence, so my attempts failed.

I would probably prefer to not have git directory in the path, but it is rather 
cosmetic. I am not sure if it is worthy fixing as WinXP are clearly coming to 
its end.

Original comment by richard....@gmail.com on 12 Apr 2013 at 3:55

GoogleCodeExporter commented 9 years ago
Thanks for checking, I don't like mysteries :)

If the quoting works, and right now it seems to, it is worth keeping in the 
plugin.  I removed it out of frustration with various flavors of windows but it 
seems VIM has gotten a bit better with command quoting since then.

Original comment by bob.hies...@gmail.com on 12 Apr 2013 at 3:58

GoogleCodeExporter commented 9 years ago
This is released in 1.99.47.

Original comment by bob.hies...@gmail.com on 13 Apr 2013 at 2:45