From de200ffdd49a3b4b3cc2dd668ed565362049cc92 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Sat, 10 Aug 2019 06:16:13 +0100 Subject: [PATCH] Document cmd.exe vulnerability where it can execute the wrong git. See #508, #538. --- README.mkd | 11 +++++++++++ doc/gitgutter.txt | 13 +++++++++++++ 2 files changed, 24 insertions(+) diff --git a/README.mkd b/README.mkd index b7b9365..54234ba 100644 --- a/README.mkd +++ b/README.mkd @@ -104,6 +104,17 @@ cp -r vim-gitgutter/* ~/.vim/ See `:help add-global-plugin`. +### Windows + +I recommend configuring vim-gitgutter with the full path to your git executable. For example: + +```viml +let g:gitgutter_git_executable = 'C:\Program Files\Git\bin\git.exe' +``` + +This is to avoid a problem which occurs if you have file named `git.*` (i.e. with any extension in `PATHEXT`) in your current folder. `cmd.exe` prioritises the current folder over folders in `PATH` and will try to execute your file instead of the `git` binary. + + ### Getting started When you make a change to a file tracked by git, the diff markers should appear automatically. The delay is governed by vim's `updatetime` option; the default value is `4000`, i.e. 4 seconds, but I suggest reducing it to around 100ms (add `set updatetime=100` to your vimrc). diff --git a/doc/gitgutter.txt b/doc/gitgutter.txt index 19037fc..1141722 100644 --- a/doc/gitgutter.txt +++ b/doc/gitgutter.txt @@ -79,6 +79,19 @@ Copy vim-gitgutter's subdirectories into your vim configuration directory: See |add-global-plugin|. +WINDOWS *gitgutter-windows* + +I recommend configuring vim-gitgutter with the full path to your git executable. +For example: +> + let g:gitgutter_git_executable = 'C:\Program Files\Git\bin\git.exe' +< +This is to avoid a problem which occurs if you have file named "git.*" (i.e. +with any extension in "PATHEXT") in your current folder. "cmd.exe" prioritises +the current folder over folders in 'PATH' and will try to execute your file +instead of the "git" binary. + + =============================================================================== COMMANDS *gitgutter-commands*