Commit Graph

1796 Commits

Author SHA1 Message Date
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 98039f3349 Move FugitivePath() away from documented functions
This function has weird semantics and does not rise to the level of its
peers.
2021-08-20 13:09:20 -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 2fc1a0017c Accept buffer numbers and dictionaries in FugitiveDetect()
This makes it easier to use FugitiveDetect() to initialize a temp file
that sits outside of the repository.
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
Tim Pope 239089f6e7 Silently ignore trees in s:BlobTemp() 2021-08-11 12:49:37 -04:00
Tim Pope f11b80022f Use jobs for calls to git update-index
This is our only use of Git that requires writing to stdin, so
shoehorning that behavior onto s:StdoutToFile() frees us from worrying
about that when designing a more general purpose API.
2021-08-11 10:59:54 -04:00
Tim Pope 56561e47a6 Use jobs to capture stdout to file 2021-08-11 04:46:07 -04:00
Tim Pope 8e4a677c7f Fix command preparation when no arguments, only flags 2021-08-10 03:10:03 -04:00
Tim Pope 35872c5dca Make prepare functions idempotent
This is limited to the single argument case so as not to interfere with
using an old command result to seed the Git dir for a new command.
2021-08-10 02:35:52 -04:00
Tim Pope 5853cb0fc3 Tweak documentation for FugitiveResult() 2021-08-10 02:35:52 -04:00
Tim Pope b20e4145c7 Convert exec path to Vim path before accessing via filesystem 2021-08-10 02:35:52 -04:00