Commit Graph

1328 Commits

Author SHA1 Message Date
Tim Pope
41beedabc7 For push map, never push to fetch remote
There are legitimate reasons to push to the fetch remote, but making it
possible from the push map makes it too easy to do by default.
2024-03-03 19:57:59 -05:00
Tim Pope
ded6eb9da3 Use fewer buffer variables for status buffer 2024-03-02 14:35:07 -05:00
Tim Pope
eedb203ba7 Introduce stat.push and stat.merge 2024-03-02 14:19:32 -05:00
Tim Pope
840ce4a9d9 Move push_remote and fetch_remote into stat 2024-03-02 13:53:14 -05:00
Tim Pope
16ffd9623e Move pull_type into stat 2024-03-02 13:50:23 -05:00
Tim Pope
85eef8003e Don't assume default value for branch.*.merge
Commands like git-merge and git-pull seem not to make this assumption,
so neither should we.
2024-03-02 13:50:21 -05:00
Tim Pope
2e88f14a58 Avoid settabvar()
Still seeing ml_get errors on older Vim.  I give up.

Resolves: https://github.com/tpope/vim-fugitive/pull/2262
2024-02-24 14:01:27 -05:00
Tim Pope
69687f28d4 Move props into stat 2024-02-18 01:09:49 -05:00
Tim Pope
4bc9d98993 Replace status buffer contents atomically 2024-02-18 01:08:14 -05:00
Tim Pope
011cf4fcb9 Give status exec result variable a clearer name 2024-02-11 21:57:03 -05:00
Tim Pope
801b0417a5 Fix shortened :call command 2024-02-11 21:57:03 -05:00
Tim Pope
9f92ff14d9 Update tabpagenr('#') version constraint to fix ml_get error
References: https://github.com/tpope/vim-fugitive/pull/2262
2024-02-11 20:53:40 -05:00
Tim Pope
2a388ef5ba Allow for numeric tab argument in <mods>
Support was added in Vim 9.0.0786.
2024-02-11 20:06:40 -05:00
Tim Pope
ddedd5bd20 Add corresponding nvim check for tabpagenr('#') 2024-02-11 16:13:25 -05:00
Tim Pope
8376227c9d Avoid tabpagenr('#') on Vim versions without it
References: https://github.com/tpope/vim-fugitive/pull/2262
2024-02-11 12:32:23 -05:00
Tim Pope
e3cdf27e19 Remove error handler from status BufReadCmd
The only error that should be possible here now is the version check, so
do that explicitly instead.
2024-02-10 19:46:54 -05:00
Tim Pope
3d9cace1ff Reorder status BufReadCmd
Put all the stuff that actually updates the buffer together, so we can
soft reload without triggering autocommands or doing redundant work.

The reason for the previous ordering was to allow a bit of parallelism
while the diff commands ran in the background.  Let's try to preserve
that for map definitions by running them in parallel to the status
command instead.

I'm not sure why 'nomodifiable' was set after BufReadPost.  Let's try
the more natural ordering and see if anything breaks.
2024-02-10 16:28:13 -05:00
Tim Pope
41ef77c058 Defer initializing b:fugitive_files until rendering status 2024-02-10 16:28:13 -05:00
Tim Pope
fab00f7c0f Always use absolute path for :Ggrep quickfix list
Ran into an issue where a running Vim (Neovim 0.9.5) consistently
treated a relative path not as the file in the current directory, but as
a different open buffer that matched the file name.  The relative path
was just for cosmetics; let's switch to absolute so Vim doesn't butcher
it.
2024-02-08 14:08:06 -05:00
Luke Davis
e7bf502a6a Avoid resetting 'last accessed tab' status 2024-02-02 11:57:28 -05:00
Alex Klapheke
f116dcc8e2 Fix misaligned output of :G blame -s
Due to a regex not capturing (and concealing) all the spaces behind
the current file's line numbers, the close parentheses after the line
numbers are misaligned, and the blame buffer is made too wide.
2024-01-27 14:36:55 -05:00
Tim Pope
854a8df0d0 Support edit script when temp dir name contains space
Looks like GIT_EDITOR supports quotes now.

Resolves: https://github.com/tpope/vim-fugitive/issues/2255
2024-01-19 18:01:25 -05:00
Tim Pope
ec8f7eed10 Fix handling of Include in SSH config
The Include directive behaves very literally.  The old implementation
assumed a level of encapsulation that just doesn't match the actual
implementation.
2024-01-17 18:49:30 -05:00
Tim Pope
ac673f1e08 Relay stdin in s:StdoutFile() on Vim 7
Resolves: https://github.com/tpope/vim-fugitive/issues/2254
2024-01-17 18:48:07 -05:00
Tim Pope
c4a38c92dc Return first, not last, value for FugitiveConfigGet() 2024-01-17 18:33:54 -05:00
Tim Pope
2c999d4a69 Fix write to index on Vim 7
Resolves: https://github.com/tpope/vim-fugitive/issues/2254
2024-01-17 18:25:41 -05:00
Gregory Anders
5965909358 Buffer output when using the pager
As of 10ed587f65 all output is captured to
a temp file before being displayed. When the output is not buffered, the
stdout/stderr callback is called to perform post-processing for each
output chunk. Instead, buffer all output and perform the post-processing
all at once.

This results in a substantial performance improvement for repositories
with many commits.
2023-12-15 18:17:17 -05:00
Tim Pope
46eaf8918b Fix variable scope 2023-10-29 13:00:04 -04:00
Tim Pope
df36d194ce Prototype "reverse :GBrowse"
Use `:Gedit https://github.com/...` (or any other URL supported by an
installed :GBrowse provider) to edit the corresponding `fugitive://`
URL.  The dictionary g:fugitive_url_origins maps between homepage URLs
and local repositories:

	let g:fugitive_url_origins = {
	      'https://github.com/me/my-repo': '~/Projects/my-repo'}

It also checks the remotes of the repository that the currently edited
buffer belongs to.

This is an experimental prototype.  That means no documentation, and no
guarantees about behavior.  In particular, g:fugitive_url_origins and
the current contortions to leverage the existing :GBrowse API will
likely be dropped once a better API has been developed.

References: https://github.com/tpope/vim-fugitive/issues/2223
2023-10-09 20:53:12 -04:00
Tim Pope
cbe9dfa162 Salvage :Ggrep ... commit:path/
Resolves: https://github.com/tpope/vim-fugitive/issues/2224
2023-10-09 20:53:12 -04:00
Tim Pope
f6ec378d1d Decouple running git-status from parsing output 2023-09-27 20:50:43 -04:00
Tim Pope
99db68d9b3 Handle status diff file arguments more rigorously 2023-09-18 11:19:09 -04:00
Tim Pope
b9cf6ad994 Avoid implicit repository when rendering status buffer
Enable this code to run asynchronously by removing any assumptions about
the current buffer.
2023-09-18 11:19:09 -04:00
Tim Pope
7679842b90 Only diff known changed files for status
This should improve performance on large repositories.

References: https://github.com/tpope/vim-fugitive/issues/2207
2023-09-17 21:11:14 -04:00
Tim Pope
86a372d8c3 Respect GIT_INDEX_FILE when diffing for status buffer 2023-09-17 21:11:14 -04:00
Tim Pope
f2133ca50b Expire cached blank Git dir on active Fugitive invocation
Resolves: https://github.com/tpope/vim-fugitive/issues/2213
2023-09-17 21:11:14 -04:00
Tim Pope
7e72fb9cde Decouple s:DirCheck() from s:VersionCheck() 2023-09-17 19:21:30 -04:00
Tim Pope
2e6cf7287c Don't bother with sleep!
Neovim doesn't properly support this.  I guess the regular behavior is
*fine*.
2023-09-17 19:21:30 -04:00
Tim Pope
b4bb0c27f1 Close stdin for nvim jobs, to match vim 2023-09-17 19:21:30 -04:00
Tim Pope
6fcb0ad039 Fix p map in blame buffers
Resolves: https://github.com/tpope/vim-fugitive/issues/2211
2023-09-08 16:21:16 -04:00
Tim Pope
ba0b3163ca Avoid double reload of status window triggered by BufEnter
The second reload was short-circuited by a reltime() check, so no big
deal, but it does get in the way when trying to make the reload
conditional.

References: https://github.com/tpope/vim-fugitive/issues/2207
2023-09-07 16:44:12 -04:00
Tim Pope
c7333f63e7 Clean up optional arguments around status reload
Best I can tell the ability to pass a line number or tab number argument
has never been used.

Cleaning this up in anticipating of adding actually useful arguments,
and in anticipation of that, I'm preemptively making ReloadWinStatus()
blindly relay any arguments to ReloadStatusBuffer().

References: https://github.com/tpope/vim-fugitive/issues/2207
2023-09-07 16:44:12 -04:00
Tim Pope
572c851012 Never jump to invalid entry after quickfix command
In particular, if the first :Ggrep result is a binary file, skip over
it.  I'm also leaning strongly towards not filling in the filename field
at all for binary files, but I'll address that separately.
2023-08-27 15:39:21 -04:00
Tim Pope
b3b838d690 Show current revert/cherry-pick in status buffer
Resolves: https://github.com/tpope/vim-fugitive/issues/2175
2023-07-04 17:44:53 -04:00
David Briscoe
5f0d280b51 Always fire BufReadStatus's autocmd
Fix #2161.

Always execute BufReadStatus's return value because that's the code that
fires the FugitiveIndex autocmd.
2023-04-28 23:23:46 -04:00
Tim Pope
e6651a79fa Allow ftplugin maps to override historical buffer maps
Resolves: https://github.com/tpope/vim-fugitive/issues/2151
2023-04-14 15:14:03 -04:00
Tim Pope
ef99f1d90c Support :GBrowse with paths outside current repo
Resolves: https://github.com/tpope/vim-fugitive/issues/2144
2023-03-30 11:01:58 -04:00
Tim Pope
9acbad1335 Try harder to match diff headers with ambiguous spacing
Resolves: https://github.com/tpope/vim-fugitive/issues/2135
2023-03-25 04:58:39 -04:00
Tim Pope
309c68117e Restore status commit lists for "." remote
Resolves: https://github.com/tpope/vim-fugitive/issues/2137
2023-03-23 07:43:56 -04:00
Tim Pope
8ad2b96cdf Guard against missing win_id2win on Vim 7.4
Resolves: https://github.com/tpope/vim-fugitive/issues/2136
2023-03-21 10:33:14 -04:00