100 Commits
Author SHA1 Message Date
Tim Pope 3b753cf8c6 Use --list-cmds=others instead of hunting through PATH
Resolves: https://github.com/tpope/vim-fugitive/issues/2458
2026-03-07 14:15:53 -05:00
Tim Pope 045d2de2d7 Add line limit to read of MERGE_MSG 2025-07-15 17:29:50 -04:00
Tim Pope 61b51c09b7 Fix race conditions generating sequencer sections
Resolves: https://github.com/tpope/vim-fugitive/issues/2411
2025-07-15 17:27:19 -04:00
Tim Pope e0715fe729 Fix check for revert/cherry-pick
Undoing a bad search and replace in
4bc9d98993
2025-07-15 17:27:19 -04:00
Tim Pope 53d6ba99bc Remove unnecessary include guard 2025-07-15 17:27:19 -04:00
Tim Pope 593f831d6f Fix interpretation of :% when % is absolute
We're trying to support two different Git syntaxes here that were never
meant to be mixed.  We want :/foo/bar to be interpreted as the pathspec
:(top)foo/bar, but we want :% to be interpreted as the % file in the
index, even when % is /foo/bar.

Resolves: https://github.com/tpope/vim-fugitive/issues/2404
2025-06-19 14:33:59 -04:00
Tim Pope 4a745ea72f Remove antiquated a map
Resolves: https://github.com/tpope/vim-fugitive/issues/2380
2025-02-19 17:44:04 -05:00
Tim Pope b068eaf1e6 Drop */# maps in visual mode
Resolves: https://github.com/tpope/vim-fugitive/issues/2374
2025-02-02 23:33:54 -05:00
Tim Pope d74a7cff4c Add cW map as commit --fixup=reword:
References: https://github.com/tpope/vim-fugitive/pull/2369
2025-01-20 01:35:07 -05:00
Tim Pope f4e8453ce7 Replace cA map with cn
Following Magit's lead.

References: https://github.com/tpope/vim-fugitive/pull/2369
2025-01-20 01:35:07 -05:00
Tim Pope de42a732ee Fix help tag for g?
References: https://github.com/tpope/vim-fugitive/issues/2320
2025-01-20 01:21:42 -05:00
Tim Pope 174230d6a7 Make :GRename ./ and ../ respect parent dir of current file
References: https://github.com/tpope/vim-eunuch/issues/114
2024-12-29 02:29:26 -05:00
Tim Pope d4877e54ce Use keepalt for diff maps
Resolves: https://github.com/tpope/vim-fugitive/issues/2336
2024-09-06 21:00:15 -04:00
Tim Pope 0444df68cd Use nvim vim.ui.open as a fallback
Resolves: https://github.com/tpope/vim-fugitive/pull/2322
2024-07-18 19:59:03 -04:00
Tim Pope 8c8cdf4405 Use callback based workflow for status buffer 2024-07-05 12:04:03 -04:00
Tim Pope d0c1a43753 Clarify dq behavior
Resolves: https://github.com/tpope/vim-fugitive/issues/2196
2024-06-25 22:34:34 -04:00
Tim Pope 64d6cafb9d Rearrange :Git documentation
Resolves: https://github.com/tpope/vim-fugitive/issues/2314
2024-06-12 12:59:20 -04:00
Tim Pope 4f59455d23 Use rev-parse to get abbrev length for status buffer 2024-05-19 10:52:16 -04:00
Tim Pope 7493b78e6b Fix :Git difftool without -y
Resolves: https://github.com/tpope/vim-fugitive/issues/2307
2024-05-19 10:52:16 -04:00
Tim Pope 09ffa8fc08 Fix :Git difftool -y
Resolves: https://github.com/tpope/vim-fugitive/issues/2306
2024-05-19 00:37:06 -04:00
Tim Pope 5a9bd42dd8 Make push map available on P
I think matching the Magit interface is probably a better use of P than
wrapping --patch.  As a baby step in that direction, allow P to invoke
the same experimental behavior as "s" or "-".
2024-05-17 16:10:36 -04:00
Tim Pope a0b0c1ddc1 Normalize path before quoting it 2024-05-17 14:01:06 -04:00
Tim Pope 10fb874d7e Filter out bold/underline typesetting in man output
Resolves: https://github.com/tpope/vim-fugitive/issues/2300
2024-05-17 13:16:03 -04:00
Tim Pope 110e7ca00c Ignore missing ssh include files 2024-05-15 12:46:29 -04:00
Tim Pope 19ca61c78c Support ~ in ssh config include
Resolves: https://github.com/tpope/vim-rhubarb/issues/79
2024-05-15 12:44:27 -04:00
Tim Pope ed9e21fb9b Support :Git difftool --check
Resolves: https://github.com/tpope/vim-fugitive/issues/2303
2024-05-14 23:46:05 -04:00
Tim Pope ce882460cf Support Git flags inside of aliases
Resolves: https://github.com/tpope/vim-fugitive/issues/2298
2024-05-01 18:17:05 -04:00
Tim Pope c0b03f1cac Restore winfixbuf consideration in status blur
The revert in a83135b55b was a bit too
aggressive.  We can support winfixbuf being set on the status buffer
without setting it ourselves.
2024-03-31 16:12:45 -04:00
Tim Pope a83135b55b Revert "Set winfixbuf on status windows"
This reverts commit 8d4e8d4538.  Once the
dust has settled I'll reconsider.

References: https://github.com/tpope/vim-fugitive/issues/2272
References: https://github.com/tpope/vim-fugitive/discussions/2275
References: https://github.com/tpope/vim-fugitive/issues/2276
References: https://github.com/tpope/vim-fugitive/issues/2278
References: https://github.com/tpope/vim-fugitive/issues/2282
References: https://github.com/tpope/vim-fugitive/issues/2286
2024-03-28 16:43:46 -04:00
Tim Pope 2377e16e66 Fix misfire of User FugitivePager
Resolves: https://github.com/tpope/vim-fugitive/issues/2283
2024-03-26 14:15:09 -04:00
Tim Pope 8d4e8d4538 Set winfixbuf on status windows
Resolves: https://github.com/tpope/vim-fugitive/issues/2272
2024-03-16 12:42:25 -04:00
Tim Pope 549e283d15 Set winfixbuf on blame windows
References: https://github.com/tpope/vim-fugitive/issues/2272
2024-03-16 12:37:29 -04:00
Tim Pope fe4ba848ba Avoid reuse of winfixbuf windows
References: https://github.com/tpope/vim-fugitive/issues/2272
2024-03-16 12:35:36 -04:00
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
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
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 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
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
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
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