* Don't attempt to handle relative paths, as there's no guarantee the
current working directory is the one Vim was started with. In
practice, the only relative path I've seen is `.git/index`, which is
already the default and thus harmless to ignore.
* Cache the result of FugitiveVimPath(), to allow for slow
implementations.
FugitiveVimPath() is intended to potentially convert between UNIX and
Windows paths in mixed environments. Let's separate uses that require
that from those that simply normalize slashes.
The 2 slash version slots the drive letter into the host field, which
I'm worried will cause problems when the URLs are used non-opaquely, for
example, with an LSP. Let's start transitioning to the convention used
by file:// URLs.
Using $GIT_DIR/index for the summary buffer has 2 problems:
* It requires a BufReadCmd for all files named "index", necessitating
special handling for false positives.
* It forces us to resolve ".git" files and symlinks, decoupling us from
the worktree and thus forcing us to depend on `core.worktree`. Git
always sets this when necessary, but users and third-party tooling
sometimes do not.
Using a fugitive:// URL for the buffer solves both.
This is a large, breaking change, so let's leave $GIT_DIR/index as the
default for now.
This is the only way to sync the line without also syncing the column.
Syncing the column is particularly problematic when it causes the blame
window to vertically scroll while typing.
This isn't a big deal for temp files themselves, but if we're checking
an arbitrary buffer, it's possible we'll end up hitting a slow network
share just to find out if the path is relative.
This new s:AbsoluteVimPath() helper could potentially be reused in a lot
of places. But this diff is big enough as is; save that for later.
This can appear to hang with 'noautoread', or if the buffer has changed
in memory. In reality it's not hanging, it's just silenced the
interactive prompt.
Resolves: https://github.com/tpope/vim-fugitive/issues/1917
Tab complete results are always passed to fnameescape(), which can
result in the output having more backslashes than the input, causing
those results to be filtered out. Attempt to reconcile this.
References: https://github.com/tpope/vim-fugitive/issues/1916