Commit Graph

1171 Commits

Author SHA1 Message Date
Tim Pope
7c0a7727c1 Allow FugitiveRemoteUrl(name, ':noresolve') 2021-08-22 02:47:00 -04:00
Tim Pope
baffbd6291 Fix config functions with config dictionary as first argument 2021-08-22 02:44:38 -04:00
Tim Pope
e7be4e4af9 Fix false positive "unknown Git error" 2021-08-22 00:21:33 -04:00
Tim Pope
c7a93960c7 Fix FugitiveRemoteUrl() 2021-08-22 00:21:33 -04:00
Tim Pope
b5a3775b64 Remove unused keys from :GBrowse options
I was hoping to one day introduce a new, backwards incompatible API
here, but adoption has gotten widespread enough that I think we're stuck
with it.  So let's go ahead and clean up some cruft that I've verified
is not in use in any known plugin.  A couple of plugins do use
repo.rev_parse(), but only inside conditionals should never be
triggered.
2021-08-21 21:26:45 -04:00
Tim Pope
1bd77bec75 Include remote_name in :GBrowse options
Uses for this are limited, but it does allow for retrieving the raw URL
before resolution, or for getting other properties from the remote's Git
config.

Also, allow FugitiveRemoteUrl(browse_opts) to directly retrieve the URL.
2021-08-21 21:26:45 -04:00
Tim Pope
39ff394b4e Rearrange fugitive#ResolveRemote()
This came out of a refactor to return the various URL components
separately.  I'm not ready to merge that, but this change feels like
enough of an improvement to merge for its own sake.
2021-08-21 21:26:45 -04:00
Tim Pope
57eeed2545 Add alternatives to :GBrowse ++remote=
In the same way Vim requires custom commands to start with an uppercase
letter, I'm starting to think we should self-impose the same constraint
on custom ++options.  Also, let's throw "Git" in there, just to allow
this to be truly unique if necessary.

This also allows a special remote argument of ".git" to refer to the
local repository.  A possible use of this would be a local gitweb
handler.
2021-08-21 21:26:45 -04:00
Tim Pope
46358f87e7 Fix U in status window
Must have fat fingered this at the last second.  I mean, I forgot the
<C-U>, but I most definitely did not forget the colon.
2021-08-20 18:50:11 -04:00
Tim Pope
66a070ab14 Use :Git --no-pager in Vim 7 to directly echo output
At long last we will have a way to directly invoke :Git from inside
various status maps without subjecting Vim 7 users to a press enter
prompt.
2021-08-20 17:23:28 -04:00
Tim Pope
05a443cd6e Add unofficial raw argument list support to fugitive#Execute()
Hedging our bets for the future.
2021-08-20 13:09:20 -04:00
Tim Pope
2c6bd3bd2d Improve tab completion for :Git push
References: https://github.com/tpope/vim-fugitive/issues/1813
2021-08-20 11:50:05 -04:00
Tim Pope
aae36024b8 Introduce FugitiveShellCommand() to replace FugitivePrepare()
We've moved on from the shell as the one true way, so let's demote the
one true preparation function.
2021-08-20 10:24:57 -04:00
Tim Pope
3125b07645 Fix :Ggrep argument parsing off-by-one error 2021-08-20 10:24:57 -04:00
Tim Pope
f674916597 Eliminate speck of repetition around :Git --no-pager
It's not the repetition that bothers me so much as the fact these two
things belong side by side.
2021-08-20 10:24:57 -04:00
Tim Pope
b70c10f2bd Disable 'more' on :Git --no-pager 2021-08-20 08:59:51 -04:00
Tim Pope
9cf20dbff5 Don't set $COLUMNS on legacy :! implementation
It's unnecessary and offensive to the eye.
2021-08-20 08:59:51 -04:00
Tim Pope
2f51a93e89 Fix pseudo-job execution on Vim 7
Closes https://github.com/tpope/vim-fugitive/issues/1815
2021-08-20 08:59:51 -04:00
Tim Pope
fd24cb2acd Add -z to :Ggrep quickfix opening flags
I mean, it's not like we can do anything else with it.
2021-08-20 00:47:49 -04:00
Tim Pope
86a45846fc Use :Ggrep -q to eschew output in favor of quickfix window
The q works on 2 levels!
2021-08-20 00:31:41 -04:00
Tim Pope
e716ebdda9 Avoid more possibilities for :Ggrep more prompt
I think this could only happen with a screen one line high, but let's
avoid tempting fate
2021-08-19 22:25:07 -04:00
Tim Pope
771d1e3711 Avoid line echo during jump to file in :Git -p grep 2021-08-19 19:36:22 -04:00
Tim Pope
01e843c21d Avoid :Ggrep interrupt leaving behind result without file 2021-08-19 19:35:33 -04:00
Tim Pope
0cbc28ba33 Avoid -- More -- prompt during :Ggrep
Resolves: https://github.com/tpope/vim-fugitive/issues/1814
2021-08-19 16:36:44 -04:00
Tim Pope
81f293852e Stream to preview window on :Git! command 2021-08-19 13:51:20 -04:00
Tim Pope
e93d45e4ce Fix constructing Git shell commands 2021-08-19 13:50:42 -04:00
Tim Pope
eafb44a720 Use jobs for :Git --paginate 2021-08-19 13:31:37 -04:00
Tim Pope
952a49f688 Tweak check for Git in PATH
First attempt was overthinking it.
2021-08-19 13:23:20 -04:00
Tim Pope
9ba2680ad5 Add special case error for failure to find Git in PATH 2021-08-19 12:13:03 -04:00
Tim Pope
98bd8428b5 Add optional callback to FugitiveConfig()
Obvious next step is to make this asynchronous, but let's settle for
getting the API in place for now.
2021-08-19 11:09:47 -04:00
Tim Pope
9ab7ac303a Accept Git dir as first argument to FugitiveRemoteUrl() 2021-08-18 13:11:57 -04:00
Tim Pope
286bf9096d Use jobs for :Ggrep 2021-08-17 22:49:39 -04:00
Tim Pope
6c18adaf98 Use jobs for quickfix commands 2021-08-17 21:47:24 -04:00
Tim Pope
9a2299038b Standardize on 'git_dir' as dictionary key
We've been moving this way for a while, but progress is slow, so let's
help it along a bit.
2021-08-17 21:47:24 -04:00
Tim Pope
809efd3f62 Fix :Gedit .git with nonstandard .git dir 2021-08-17 20:43:53 -04:00
Tim Pope
9216210b86 Pass --git-dir= alongside -C for nontrivial cases
References: https://github.com/tpope/vim-fugitive/issues/1796
2021-08-17 20:29:09 -04:00
Tim Pope
64133cae30 Avoid unnecessary -C when querying Git config
Let's keep this low level operation away from any wonkiness caused by a
missing or bad core.worktree.
2021-08-17 20:29:09 -04:00
Tim Pope
9b31f4bee5 Include cwd in fugitive#Execute() result
I guess we should allow for the future possibility the working directory
can be specified.
2021-08-17 19:59:04 -04:00
Tim Pope
40542f1dd1 Include --no-literal-pathspecs in FugitiveResult().flags
This allows for passing the result to helpers like
fugitive#ShellCommand() without its own path munging behaviors kicking
in.
2021-08-17 19:11:30 -04:00
Tim Pope
2039676d97 Respect environment variable overrides when opening terminal 2021-08-17 17:19:46 -04:00
Tim Pope
f047d8250d Improve check for job environment variable support
The patch specified was incorrect for Vim, and this api_info() malarkey
appears to be the only way to check for Neovim 0.5.0 proper.
2021-08-17 17:19:46 -04:00
Tim Pope
80e7c63fb1 Support jump to file under cursor in :Git -p grep
This also adds support for :Git -p status, since we basically already
have an implementation for it.
2021-08-17 17:18:20 -04:00
Tim Pope
2d3e83abe3 Improve git grep argument handling
Add a parsing special case for --count, and improve the handling of
--open-files-in-pager.
2021-08-17 13:07:41 -04:00
Tim Pope
b5e7e1ba24 Don't match :0: as line number in :Ggrep
This is explicitly to help with false positives in surrounding context
while grepping this very file, as :0: is used in numerous places to
reference blobs in the index.  We also use :1: and company in a few
places, but a robust fix is much harder.
2021-08-16 18:28:27 -04:00
Tim Pope
f3e92c7721 Deprecate CTRL-N and CTRL-P 2021-08-14 10:23:57 -04:00
Tim Pope
bec8e7b7c7 Don't override user maps with removal notices
Resolves: https://github.com/tpope/vim-fugitive/issues/1811
2021-08-14 10:23:28 -04:00
Tim Pope
6c53da0783 Use jobs for all Git execution helpers 2021-08-12 07:24:41 -04:00
Tim Pope
b709d9f782 Avoid shell with nvim terminal 2021-08-11 17:21:38 -04:00
Tim Pope
0b53a4daff Override GIT_INDEX_FILE when belonging to wrong repository
GIT_INDEX_FILE is typically set to index.lock when Vim is invoked by
`git commit`.  This effectively breaks Fugitive if you try to use it in
a different repository while inside that Vim session.  To remedy this,
we can instead point GIT_INDEX_FILE at the index file for the relevant
repository.

This also retools command preparation to allow for general purpose
environment variable overrides.
2021-08-11 17:02:26 -04:00
Tim Pope
7a34996886 Use jobs for FileReadCmd 2021-08-11 12:55:18 -04:00