Commit Graph

2149 Commits

Author SHA1 Message Date
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
d4914b361b Discourage use of P and ~ in blame window.
Since 09908d82ef, I've been getting a
parade of issues and PRs about "missing" documentation.

Resolves: https://github.com/tpope/vim-fugitive/pull/2210
References: https://github.com/tpope/vim-fugitive/issues/2070
2023-09-06 14:33:40 -04:00
Tim Pope
f71fb99360 Clarify behavior of :G summary window
Resolves: https://github.com/tpope/vim-fugitive/issues/2192
2023-09-03 15:27:15 -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
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
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
66e8d19f89 Document czs
References: https://github.com/tpope/vim-fugitive/issues/1941
2023-03-22 02:52:30 -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
Tim Pope
5b52a0f395 Provide default merge head for "." remote
Almost included this in f75dbb1967, but
dropped it because it always equal to the current branch, guaranteeing
an empty log, and because unlike the "origin" default, it shouldn't
really happen in practice.  However if a user screws up their config in
a way that forces it to happen, we should still try to avoid the same
"Push" header issue.
2023-03-09 14:20:42 -05:00
Karl Yngve Lervåg
d4941aec93 Use the dir variable in fugitive#Head 2023-03-09 11:55:42 -05:00
Tim Pope
82a9af133c Reject remotes without appropriate push/fetch key
Verifying by URL is insufficient, as git clone --bare will create a
remote with a URL but not a fetch key, resulting in no refs in
refs/remotes/.

Resolves: https://github.com/tpope/vim-fugitive/issues/2129
2023-03-07 19:11:04 -05:00
Tim Pope
13ed146694 Fix duplicate "Unpulled" section when push and pull match 2023-03-07 19:07:28 -05:00
Tim Pope
9b72d0c7c8 Don't default to origin remote in bare repos
Resolves: https://github.com/tpope/vim-fugitive/issues/2129
2023-03-07 14:57:08 -05:00
Tim Pope
f75dbb1967 Default pull ref to branch of same name
If we defaulted branch.x.remote to "origin", then we should also default
branch.x.merge to the obvious choice.  Otherwise we can end up in the
situation of a push ref without a pull ref, which leads to a rather
confusing "Push" header without a "Merge"/"Rebase" header.

References: https://github.com/tpope/vim-fugitive/issues/2129
2023-03-07 14:57:08 -05:00
yasuda
c9c08ff9ef Fix dropped quote of entries 2023-03-06 22:03:53 -05:00
Tim Pope
01964fa859 When push ref is missing, show unpushed upstream commits instead
This is a lie, but it matches what I (and probably most people) expect
to happen.
2023-03-06 20:34:16 -05:00
Tim Pope
d5758be511 Refactor retrieval of push/pull refs in status buffer, again
My last attempt at this gave up and combined retrieving the list of
commits and rendering the list of commits into a single function.  This
restores that distinction, albeit with a different approach, as I now
aim to use the same list of commits twice, in some circumstances.
2023-03-06 20:34:16 -05:00
Tim Pope
caf1bc99b6 Fall back to "Unpushed to *" when no upstream head is found
This allows local history to be shown before the initial push to a brand
new repository.

References: https://github.com/tpope/vim-fugitive/issues/2106
2023-03-05 20:02:07 -05:00
Tim Pope
b265dba99a Retool retrieval of push/pull refs in status buffer
This is mostly a refactor, but it fixes a bug where we could end up with
a push ref but not a pull ref when the underlying remote didn't exist,
resulting in a "Push:" header but not a "Pull:" header, which is
nonsensical.  This changes it to produce a "Pull:" header but not a
"Push:" header, which is arguably still incorrect, but at least makes
logical sense.
2023-03-05 20:02:07 -05:00
Tim Pope
891b0a92fe Don't show "Unpushed to *" if no remotes
If there are no remotes, then this section will always contain the
entire branch history, or a truncated version thereof.  I want all
sections to be meaningfully bounded.
2023-03-05 20:02:07 -05:00
Tim Pope
fa33145cc1 Make commit/rebase maps available in blame buffers
Resolves: https://github.com/tpope/vim-fugitive/issues/2035
2023-03-02 19:36:21 -05:00
Tim Pope
bba8d1beb3 Avoid narrow :Git subcommand splits in blame windows
If commit maps are to made available in blame buffers, then the existing
behavior of editing the commit message in a horizontal split of a narrow
window isn't going to cut it.  My ideal solution would be to create a
split that spans both the blame buffer and the original file, but I
don't think there's a practical way to do that, so I've instead settled
for using :topleft/:botright instead, as appropriate.  The other natural
solution would be to switch to the original file and split there, but
that means we'd end up with a scroll-bound window with a mismatched
height, which behaves exactly as poorly as you would expect.

Furthermore, I've made the decision to extend this behavior to paginated
output windows (e.g., `:Git log`), but *not* to other window creation
commands like :Gsplit.

References: https://github.com/tpope/vim-fugitive/issues/2035
2023-03-01 23:07:06 -05:00
Tim Pope
e5f9fda842 Tighten matches for URL buffer names 2023-03-01 16:42:10 -05:00
Tim Pope
b54ee90d56 Avoid blurring status when :Gedit argument parsing throws an error 2023-03-01 16:42:10 -05:00
Tim Pope
d507d00bd0 Drop g:fugitive_defer_to_existing_maps
This doesn't actually work correctly as in a few places we deliberately
override a map.  I'll accept a PR to bring it back, but it will need to
fix said issues.  Until then, unmapping undesired maps is the
recommended solution.
2023-02-27 21:52:52 -05:00
Tim Pope
ad2dcd628a Undo inadvertent revert
This reverts commit dd538bb046.
2023-02-27 21:08:30 -05:00
Tim Pope
dd538bb046 Fix typo 2023-02-27 20:49:41 -05:00
Tim Pope
853ec6f58d Focus correct window after gq in :Git blame
Resolves: https://github.com/tpope/vim-fugitive/issues/770
2023-02-27 20:47:22 -05:00
Ben Morgan
62f42f013d Fix Gdelete error message 2023-02-09 16:44:40 -05:00
Tim Pope
2019e0e413 Support folding sections
Resolves: https://github.com/tpope/vim-fugitive/issues/2111
References: https://github.com/tpope/vim-fugitive/issues/1317
2023-02-05 18:40:33 -05:00
Tim Pope
2febbe1f00 Make statusline redraw less aggressive
Mainly trying to avoid tainting `:verbose set readonly?`.
2023-01-16 22:04:38 -05:00
Tim Pope
9b50074e44 Better error message when :GBrowse remote not found
Resolves: https://github.com/tpope/vim-fugitive/issues/2103
2023-01-16 22:04:38 -05:00
Tim Pope
9c5f675db5 Allow PTY for paginated shortlog, to prevent stdin read
This workaround only works where PTY jobs are supported.  The real fix
is to give an explicit argument: `:Git shortlog HEAD`.

Resolves: https://github.com/tpope/vim-fugitive/issues/2100
2023-01-11 20:22:15 -05:00
Tim Pope
99cdb88bc6 Improve horizontal scrolling performance of :Git blame
References: https://github.com/tpope/vim-sensible/pull/124
2022-12-30 00:44:37 -05:00