This is currently a valid assumption, but it boxes us in. Instead use
fugitive#Find('.git/'), which is guaranteed to return a path to an
actual directory.
Also use fugitive#Find('.git/refs/..') to determine the common
directory.
This renders a lot of other version checks inside the plugin obsolete,
but I'm going to hold off on cleaning them up until I'm sure this change
is permanent.
* Replace :! :Git backend with smart job runner.
* Replace special cased commit/revert/rebase/merge/etc. with regular :Git.
* Support :Git -c config.name=value and other common flags.
* Improve completion of :Git subcommands, including hiding plumbing commands.
* Improve completion of arguments to :Git subcommands.
* Show unpulled and unpushed sections for both upstream and push remote.
* Introduce capitalized naming scheme for :GMove/:GRename/:GRemove/:GDelete/:GBrowse.
* Expand SSH host aliases in remote URLs for :GBrowse.
* Enable opening arbitrary URLs with :GBrowse.
* Add warnings to deprecated commands.
* Remove all other temp buffer commands in favor of :Git --paginate.
* Don't automatically invoke :setlocal foldmethod=syntax in Fugitive buffers.
* Support colored :Git blame commits in 256 color terminals.
* Bug fixes.
This is a little clunky, but enabling !empty(FugitiveGitDir()) to work
in autocommands that trigger before ours should provide an acceptable
replacement for the "User Fugitive" event and will hopefully enable us
to unltimately eliminate preemptive detection entirely.
If g:fugitive_result is defined during the User FugitiveChanged event,
one can trigger a custom behavior based on the arguments in .args or the
output in .file.
References https://github.com/tpope/vim-fugitive/pull/1015
A common practice for using multiple accounts with a hosting service
such as GitHub is to alias the host in ~/.ssh/config and use an
alternate ssh key to authenticate as the alternate user:
Host github.com-work
HostName github.com
IdentityFile ~/.ssh/id_rsa_work
By swapping in the original host name for the alias in
FugitiveRemoteUrl(), we can enable :GBrowse plugins to correctly
recognize the hosting service's domain name.
If for some reason you need the original URL without modification, pass
a true value as the third parameter:
let url = FugitiveRemoteUrl('', bufnr(''), 1)
References https://github.com/tpope/vim-rhubarb/issues/60
In order for these checks to work, :filetype on must be invoked *after*
Fugitive is loaded. Otherwise, the FileType event triggers before
FugitiveDetect() is called.
These file types are used almost exclusively inside of Git repositories,
and in the rare case they are not, we're not doing anything particularly
intrusive, so dropping the conditional should have little practical
impact. An exception is fugitive#MapJumps(), which is designed to be
used exclusively with historical buffers, the status buffer, and
captured :Git output, so let's lock it down to those particular
workflows.
I'm starting to think :Git grep shouldn't be special cased.
Occasionally it is desirable to see grep results without clobbering the
quickfix list.
Reserve -O/--open-files-in-pager to opt into quickfix behavior, as this
fits well with Fugitive's use of a temp buffer as the Git pager.
Ever since Vim gained -addr=, it's been impossible to define a command
that accepts both marks like '< (requires -addr=lines) an and a count
that's beyond the end of the file (requires -addr=other). This means
:Git needs to pick sides between :'<,'>Git blame and :{windowheight}Git
log, and the former is much more important than the latter.
The long term goal is to use :Gsomecommand for commands that wrap
Vim built-ins (e.g., :Gedit for :edit), :Git some-command for commands
that wrap Git built-ins, and :GSomeCommand for everything else. For
:GRemove, :GDelete, :GMove, and :GRename, this gives us symmetry with
eunuch.vim, and for :GBrowse, this gives us symmetry with a hypothetical
:Browse command that I've long wanted to make a plugin for but probably
never will.
:GcLog and :GlLog get their names because they match Vim's :c and :l
prefixes but bring their own custom suffix. This is rather unsatisfying
and I may change it if something better comes along.
In particular, this fixes `FugitiveFind(..., '')` to respect the empty
Git dir argument rather than falling back to detection on the current
working directory. Which in turn fixes :Gstatus using the current
working directory when called from a buffer that does not belong to a
repository.
References https://github.com/tpope/vim-fugitive/issues/1408
* Commands are now global, not buffer local.
* Calling a command in an unnamed buffer uses the working directory.
* Preserve line number on :Gedit to return to work tree buffer.
* Better submodule support in :Gstatus.
* Support git-blame revision ignoring features.
* Show first parent diff in merge commit buffer.
* Remove deprecated support for .git/tags.
* Bug fixes.