Commit Graph

1004 Commits

Author SHA1 Message Date
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
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
b20e4145c7 Convert exec path to Vim path before accessing via filesystem 2021-08-10 02:35:52 -04:00
Tim Pope
d1970112f4 Rename #Prepare to #ShellCommand
Shell commands are on their way out.  Let's start reclaiming this verb.
2021-08-10 00:35:17 -04:00
Tim Pope
371a5062d3 Separate out flags when parsing Git arguments
This will enable us to construct an execution result dictionary similar
to FugitiveResult().
2021-08-10 00:25:49 -04:00
Tim Pope
4adf054a3f Fix fugitive#writefile() when staging new file 2021-08-08 22:45:10 -04:00
Tim Pope
19e7604839 Use Git paths when passing temp files to hash-object 2021-08-08 22:36:30 -04:00
Tim Pope
b8ba07f7d8 Improve flexibility of public API argument order
This allows tomfoolery like FugitiveConfig(dir)->FugitiveConfigGet(key).
I'm not sure I want to officially endorse this usage, but if nothing
else it makes interactive debugging a bit more fluid.
2021-08-08 00:48:27 -04:00
Tim Pope
55382eb722 Fix usage of index() 2021-08-07 16:19:02 -04:00
Tim Pope
2ee6a48d0b Apply insteadOf to raw remote URLs in addition to remote names
This also retools FugitiveRemoteUrl() argument handling to be a bit more
flexible.
2021-08-07 15:51:07 -04:00
Tim Pope
8def00c247 Homogenize calls to private exec helpers
Replace calls of the form f(dir, arg1, arg2) with f([dir, arg1, arg2]).
2021-08-07 15:51:07 -04:00
Tim Pope
8082606fd0 Fix direct usage of fnameescape()
I plan to lower the minimum Vim version back to 7.0 before shipping 3.4,
which means we can't assume the presence of fnameescape().
2021-08-07 15:51:07 -04:00
Tim Pope
2dc08dfe35 Rename and relocate s:TempCmd() 2021-08-06 22:00:55 -04:00
Tim Pope
a25d4d6961 Fix read command output into buffer with guioptions=! 2021-08-06 21:35:43 -04:00