803 Commits

Author SHA1 Message Date
Tim Pope
c4a38c92dc Return first, not last, value for FugitiveConfigGet() 2024-01-17 18:33:54 -05:00
Tim Pope
43f18ab915 Support netrw buffers with blank buffer names
Resolves: https://github.com/tpope/vim-fugitive/pull/2179
2023-06-12 19:27:31 -04:00
Ben Morgan
62f42f013d Fix Gdelete error message 2023-02-09 16:44:40 -05:00
Ernst Widerberg
362201bce5 Fix typo 2022-11-15 04:53:25 -05:00
Tim Pope
b411b753f8 Add deprecation warning on editing .git/index 2022-08-17 10:20:51 -04:00
Tim Pope
f0acd25d45 Accept multiple arguments to :Gdrop, like :drop 2022-06-29 14:20:56 -04:00
Tim Pope
33a7cdf213 Fix FugitiveExtractGitDir() with dict argument
Resolves: https://github.com/tpope/vim-fugitive/issues/2018
2022-06-24 17:00:33 -04:00
Tim Pope
80cd9c876e Move FugitiveParse() implementation into autoload file
Anticipating changes here, so let's try to avoid the dreaded "old plugin
file loads new autoload file" edge case burning us.
2022-06-23 18:09:40 -04:00
Tim Pope
8165eada59 Fix Projectionist root for .git/info/projections.json 2022-06-23 17:55:27 -04:00
Tim Pope
aafbdf84cd Look for "fugitive_dir" as dictionary key
Work trees and submodules have two things that could be called the Git
dir: the directory itself, and the ".git" at the root of the work tree.
Introduce "fugitive_dir" as our name for the one we consider canonical.
2022-06-22 12:30:47 -04:00
Tim Pope
9fadd7a778 Provide :Gdrop 2022-06-16 09:41:34 -04:00
Tim Pope
acee967384 Remove :Gcommit family of error stubs 2022-06-16 09:41:34 -04:00
Tim Pope
0996bae836 Partially support ".git" files and symlinks without core.worktree
This is not and can never be 100% perfect.  There's no way to work back
from a file like info/exclude COMMIT_EDITMSG to the work tree.  So
core.worktree continues to be recommended.

References: https://github.com/tpope/vim-fugitive/issues/1920
2022-06-13 12:15:48 -04:00
Tim Pope
d72fbcb0a4 Loosen autocommand patterns for fugitive:// URLs
Allow for potential upcoming changes to the format.
2022-06-13 10:09:36 -04:00
Tim Pope
0680c3ae3c Remove last vestiges of :Gread! 2022-06-13 07:13:34 -04:00
Tim Pope
8378b329b8 Drop obsolete public functions 2022-06-07 05:40:49 -04:00
Tim Pope
118e9de937 Define global <Plug> maps regardless of g:fugitive_no_maps 2022-06-07 04:03:42 -04:00
Tim Pope
4aeca0c566 Drop support for Vim older than 7.4 2022-06-07 03:14:49 -04:00
Tim Pope
55256c7de2 Fix syntax error
Resolves: https://github.com/tpope/vim-fugitive/issues/2008
Resolves: https://github.com/tpope/vim-fugitive/issues/2009
2022-06-07 02:10:42 -04:00
Tim Pope
2386b9b39f Drop support for autocmd User Fugitive 2022-06-07 01:09:56 -04:00
Tim Pope
96c1009fcf fugitive.vim 3.7
Move "Unpushed" sections above "Unpulled".
Show commits that are unpushed anywhere when no upstream is set.
Provide czs map as :Git stash push --staged.
Support the MSYS Vim bundled with Git for Windows.
Turn remaining deprecated commands (:Gbrowse, etc.) into error stubs.
2022-06-07 01:03:24 -04:00
Tim Pope
5920f807f5 Expire b:git_dir on buffer rename 2022-06-03 20:33:48 -04:00
Tim Pope
596621dc6e Support Git for Windows bundled MSYS Vim
References: https://github.com/tpope/vim-fugitive/issues/1970
2022-05-30 16:48:48 -04:00
Tim Pope
5bf3fd40f6 Provide FugitiveActualDir()
This is intended to free up FugitiveGitDir() to refer to the ".git" file
in that work tree and submodule repositories use.  I wish I had better
names for these two.  Settling for "Actual" as that at least has a
pleasing 6 letter symmetry with "Common".
2022-05-30 14:03:43 -04:00
Tim Pope
950f9c49fc Introduce helper to normalize to backslashes on win32
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.
2022-05-30 14:03:43 -04:00
Tim Pope
92870eb6d2 Remove dead code for resolving symlinked buffer name
The `:p` flag resolves symlinks, so the resolve() call is a no-op, and
the subsequent conditional is always false.  It also appears to be no
longer necessary, though I'd have to do a bit more digging to figure out
why.
2022-05-28 21:57:21 -04:00
Tim Pope
5ec0793b88 Accept both fugitive://C:/ and fugitive:///C:/ on win32
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.
2022-05-28 21:00:24 -04:00
Tim Pope
ad16275775 Fix statusline indicator on older Vim
Vim was clearing the statusline due to an error, despite the fact the
exception was caught and ignored.
2022-05-27 22:56:20 -04:00
Tim Pope
097ce939da Make summary buffer available at fugitive:// URL
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.
2022-05-27 19:50:53 -04:00
Tim Pope
f48cbb92c5 Read more of config file for core.worktree check
References: https://github.com/tpope/vim-fugitive/issues/1920
2022-05-21 21:35:50 -04:00
Tim Pope
b04708af2d Revert "Avoid IO from ":p" during detection"
This change failed to account for the directory edge case, where ":p:h"
has the very nice property of giving us back the original input, due to
":p" appending a trailing slash.  Without this, we fail to detect when
editing the root of the repository.

This reverts commit 1b811b88a4.

Resolves: https://github.com/tpope/vim-fugitive/issues/1978
Resolves: https://github.com/tpope/vim-fugitive/issues/1979
2022-04-20 23:25:14 -04:00
Tim Pope
1b811b88a4 Avoid IO from ":p" during detection 2022-04-20 18:29:45 -04:00
Tim Pope
ed1ff363df Remove another acwrite check 2022-04-20 18:29:45 -04:00
Tim Pope
e064f42770 Don't consider buftype=acwrite buffers to have real filenames
Immediately after I changed this I rediscovered the documentation at
`:help E676`.
2022-04-20 18:28:44 -04:00
Tim Pope
200593827e Adjust handling of 'buftype' during detection 2022-04-19 18:35:15 -04:00
Tim Pope
4b0f2b6045 Default g:ceiling_directories to parent of $HOME
References: https://github.com/tpope/vim-fugitive/issues/1457
2022-04-14 02:31:49 -04:00
Tim Pope
d725ef529e Turn remaining deprecated commands into error stubs 2022-04-01 18:27:49 -04:00
Tim Pope
8157efff49 Provide g:fugitive_defer_to_existing_maps
References: https://github.com/tpope/vim-fugitive/issues/1425
2022-03-25 18:08:01 -04:00
Tim Pope
b6405d8908 Provide literally named <Plug> maps
For every map X, also provide a map <Plug>fugitive:X.

References: https://github.com/tpope/vim-fugitive/issues/1425
2022-03-25 17:50:32 -04:00
Tim Pope
46652a304f Add :GUnlink, like in eunuch.vim
This currently mirrors :GRemove, but gives us the option to add a third
variant.
2022-03-09 10:50:24 -05:00
Tim Pope
485ce07c27 Match FugitiveRemote() interface to window.location in JS 2022-02-11 13:02:45 -05:00
Tim Pope
a93ceff61f Support extensions.worktreeConfig
Resolves: https://github.com/tpope/vim-fugitive/issues/1898
2022-01-13 14:06:42 -05:00
Tim Pope
f4d94c5985 Move CommonDir() from autoload to plugin 2022-01-11 18:47:38 -05:00
Tim Pope
189e3c406e Eliminate filereadable() guards by catching readfile() error 2022-01-11 18:36:36 -05:00
Tim Pope
944dc602c6 Require core.bare=true for bare repositories
Resolves: https://github.com/tpope/vim-fugitive/issues/1920
2022-01-11 13:50:55 -05:00
Tim Pope
b6dbb97759 Extend lazy detection to netrw
The requires dropping support for b:netrw_curdir, which was added in
fecd42864a for the vague reason of
handling "unusually named netrw buffers".  I'll figure out what to do
about those alleged buffers when one of them surfaces again.
2022-01-05 11:07:15 -05:00
Tim Pope
831fdab983 Simplify extraction of directory of buffer name
The behavior of :p is more predictable than I realized when I first
wrote this.
2021-12-28 16:03:34 -05:00
Tim Pope
f18571e647 Remove redundant ":p" modification during detection
Every ":p" does I/O to check for a directory, so let's do away with the
belt-and-suspenders usage.
2021-12-23 15:00:14 -05:00
Tim Pope
79c2b3f48d Try nested autocmds for ReadCmd/WriteCmd
I'm trying to leverage OptionSet for something.  Let's see if this
causes issues for anybody.
2021-12-07 09:17:47 -05:00
Tim Pope
5a24c25275 fugitive.vim 3.6
* Fix support for older Vim 7 patch levels.
* Support copies on :Gclog --follow.
2021-11-25 14:53:57 -05:00