Commit Graph

1171 Commits

Author SHA1 Message Date
Tim Pope
24d1c60364 Unify location of blame maps 2021-06-25 17:14:37 -04:00
Tim Pope
79e2bd381a Fix pager usage for :Git reflog
Resolves: https://github.com/tpope/vim-fugitive/issues/1772
2021-06-19 19:39:21 -04:00
Tim Pope
857c107e5a Fix typo 2021-06-19 12:40:17 -04:00
Tim Pope
be9ff95f27 Avoid guioptions=! issues in :Git --paginate
Resolves: https://github.com/tpope/vim-fugitive/issues/1767
2021-06-11 17:41:37 -04:00
Tim Pope
c26b4b018a Fix shell escaping edge case on win32
This is a proactive fix; no erroneous behavior has been observed.
2021-06-11 17:41:37 -04:00
Tim Pope
41960996e0 Eliminate unnecessary redraw to clear up :Gdiffsplit sync issue
Resolves: https://github.com/tpope/vim-fugitive/issues/1750
2021-06-06 15:38:10 -04:00
Tim Pope
8886d97070 Fix missing bang on function declaration
This causes a error during reloading on older versions of Vim.
2021-06-06 15:38:10 -04:00
Tim Pope
f7f1413ed9 Disable PTY when using win32 Git in WSL
References: https://github.com/tpope/vim-fugitive/issues/1751
2021-06-02 23:00:19 -04:00
Tim Pope
10ed70a9c2 Don't call exists() on invalid function name
References: https://github.com/tpope/vim-fugitive/issues/1751
2021-05-31 19:37:14 -04:00
Tim Pope
9871822dd5 Avoid possible hang on failure to start job
References: https://github.com/tpope/vim-fugitive/issues/1751
2021-05-28 17:20:01 -04:00
Tim Pope
6ae064c5aa Tighten match for commit under cursor in temp buffers
Closes https://github.com/tpope/vim-fugitive/issues/1756
2021-05-27 10:37:24 -04:00
Tim Pope
798f65a180 Fix variable reference in s:Remote() 2021-05-27 10:37:24 -04:00
Tim Pope
da8d532b1a Support default value as third FugitiveConfigGet() argument 2021-05-26 09:23:34 -04:00
Tim Pope
bee78a418f Unify use of FugitiveConfig helpers 2021-05-26 09:15:25 -04:00
Tim Pope
28afd12151 Handle quoted strings in g:fugitive_git_executable
Taking the option that was historically a shell command and treating it
as a space-delimited argument list means that there's no longer any way
to include a space in an argument.  Let's rectify that by reusing a
simplified version of the argument parser in s:SplitExpandChain(), which
handles both single and double quoted strings in a way similar to how
shells do it.

Of course, the ideal solution is to just use a list of strings to begin
with.  Support for that is added here as well.

References: https://github.com/tpope/vim-fugitive/issues/1751

# This is the commit message #2:

squash! Accept argument list for g:fugitive_git_executable
2021-05-26 08:53:51 -04:00
Tim Pope
dd01e40106 Use local not upstream branch name for :GBrowse default
When I first wrote this code, I believed push.default=upstream to be the
One True Way, and I used the upstream as the default branch when one
wasn't passed into :GBrowse.  Since then, my preferred workflow has
shifted to push.default=current, with my upstream pointed at the
repository's integration branch (typically master), which means :GBrowse
effectively ignores our current branch, which is less than helpful.

This change eliminates :GBrowse's use of the upstream tracking branch
except in 2 scenarios:

* When push.default=upstream
* When the current branch has never been pushed (since using the current
  branch would result in a 404).
2021-05-26 08:53:51 -04:00
Tim Pope
47a07a0a32 Standardize method for disabling foldmethod=marker
The foldmarker option does appear to be buffer local (despite being
documented as window local), so it should be safe to use this
everywhere.
2021-05-26 08:53:51 -04:00
Tim Pope
7a75c18554 Fix :Git mergetool line offset
This was broken in 895e56daca by
misreading a version constraint.

Resolves: https://github.com/tpope/vim-fugitive/issues/1755
2021-05-26 08:53:51 -04:00
Maksim Odnoletkov
c926aadfaf Fix deprecation error in :GBlame 2021-05-18 14:40:47 -04:00
Tim Pope
32b0d62663 Hunt other tabs for window on :tab Git
I'm not 100% sure if this is the correct (as in least surprising)
behavior, but it seems like as good of place as any to start.

Closes https://github.com/tpope/vim-fugitive/issues/1740
2021-05-02 06:52:14 -04:00
Tim Pope
f7a6097caa Change deprecated q and D maps to errors 2021-04-22 18:20:15 -04:00
Tim Pope
b227b887bb Replace HEAD with @
The @ shortcut for HEAD was introduced in 1.8.5, which we now require.
2021-04-16 15:19:39 -04:00
Tim Pope
895e56daca Require Git 1.8.5 or newer
The removed checks for 1.9 were rounded up 1.8.5 requirements.  This
version has everything we need.
2021-04-16 15:19:39 -04:00
Tim Pope
9a1dab0b27 Require Vim 7.4 or newer
This renders a lot of other version checks inside the plugin obsolete,
but I'm going to hold off on cleaning them up until I'm sure this change
is permanent.
2021-04-16 09:27:25 -04:00
Tim Pope
4139dc521c Support :Gwrite +aftercommand
Closes https://github.com/tpope/vim-fugitive/pull/562
2021-04-15 10:15:29 -04:00
Tim Pope
f72ad60097 Only do "guessed" :Gwrite behaviors with no argument
These seem pretty silly these days and should probably be removed, but
let's start by reducing their scope.
2021-04-15 10:15:29 -04:00
Tim Pope
8686eb17e0 Fix :Git difftool work-tree paths
I don't think the change that this reverts was necessarily wrong,
but this isn't the best time in the release cycle to play whack-a-mole
with unintended consequences.

Closes https://github.com/tpope/vim-fugitive/issues/1732
2021-04-15 09:05:31 -04:00
Tim Pope
1d00a7392b Fix :GBrowse :/ in bare repositories 2021-04-13 13:01:07 -04:00
Tim Pope
054fca2269 Return empty string on FugitiveFind() with no Git dir
Previously, we would return a path from the current working directory in
this case, which was a good fallback for :Gedit but unhelpful for
general programmatic usage.
2021-04-13 08:08:59 -04:00
Tim Pope
7866e83cc2 Fix :Gedit / 2021-04-13 08:07:40 -04:00
Tim Pope
503c22f1f5 Fix status in bare repository 2021-04-13 08:03:28 -04:00
Tim Pope
54cc9d01ad Always set b:git_dir
This makes it possible to tell when detection hasn't happened yet, and
is potentially a stepping stone to doing it on the fly.
2021-04-12 13:31:42 -04:00
Tim Pope
649cb2dc05 Add deprecation warnings to :Glog and :Gstatus 2021-04-12 12:07:52 -04:00
Tim Pope
94bc89da0f Don't use pty on win32unix
This appears to work fine in some setups, but has the same problems
as regular win32 in others.  Most notably, for it to work properly with
the Vim included with Git for Windows, the experimental pseudo console
support must not be enabled.  Lacking a method to distinguish between
the two cases, I see no better option than disabling it on all win32unix
installations.

Closes https://github.com/tpope/vim-fugitive/issues/1726
2021-04-10 21:35:49 -04:00
Tim Pope
222c9ccbc6 Don't trigger BufWrite during :Git blame
Closes https://github.com/tpope/vim-fugitive/issues/1724
2021-04-08 21:26:55 -04:00
Tim Pope
8ede0aaf57 Provide :GBrowse behavior in blame buffers
If a line number is given, browse to the commit on that line.
Otherwise, browse to the file, same as if called from the original
buffer.

It would probably make more sense to open the corresponding blame page
on providers that support it, but that will have to wait on an API
change.

References https://github.com/tpope/vim-fugitive/issues/1214
2021-04-07 01:04:36 -04:00
Tim Pope
3a319cd5b8 Don't rely on current buffer's Git dir for :GBrowse
This makes :GBrowse fugitive://... work when the buffer name is from a
different repository.  It doesn't solve the harder problems of making it
work with a regular filename, or making it not bail early when the
current buffer doesn't belong to a repository at all.
2021-04-07 01:04:36 -04:00
Tim Pope
cd8bd39567 Support all <cword> style expansions
The previous implementation for <cfile> didn't handle <cfile>:h
correctly.  May as well support the rest of the gang while fixing this.
Note that unlike for % and #, these can return a commit in addition to a
file name.  Use a ":." expansion, as in "<cfile>:.", to get the
corresponding work tree file.
2021-04-07 01:04:36 -04:00
Tim Pope
d4d2b9c6b2 Ignore :GBrowse line numbers for non-blob objects
Pave the way to use these for other purposes.
2021-04-06 23:41:18 -04:00
Tim Pope
485251ec73 Provide "." and "<C-R><C-G>" in blame buffers 2021-04-06 23:41:18 -04:00
Tim Pope
50b57ba400 Fix double "fugitive:" in error message 2021-04-06 23:41:18 -04:00
Tim Pope
87b169728c Add aliases for blame "-" map
This is one of the more common conflicts people have with their own
maps, so make it available on "s" and "u".  This roughly lines up with
the status buffer maps, which I think is as good of decision as any,
lacking a better mnemonic.
2021-04-06 20:43:26 -04:00
Tim Pope
f29c9e5079 Support :GBrowse {url} outside of Git repository 2021-04-04 18:26:17 -04:00
Tim Pope
81074db0ee Pass <mods> along to URL opener
I don't know if there is a use for this, but it seems like the right
thing to do.
2021-04-03 23:35:42 -04:00
Tim Pope
2ef9d9a748 Use :echo not :echomsg for displaying :GBrowse URL
Logging the URL permanently to :messages was a mistake.
2021-04-03 23:35:42 -04:00
Tim Pope
ce58344c9e Jump to correct Unpushed/Unpulled section on reload 2021-04-03 20:44:31 -04:00
Tim Pope
d3341147ef URL escape :command special characters
Handle the case where the :Browse or :OpenBrowser command we delegate to
is defined with -bar.
2021-04-03 20:44:31 -04:00
Tim Pope
1a765a46c1 Add git_dir key to :GBrowse API
This enables passing the whole options dictionary to helpers like
FugitiveWorkTree().
2021-04-03 20:44:31 -04:00
Tim Pope
5a54ea4333 Handle race condition closing job stdin
This race condition is there for any key press, but it's greatly
exaggerated by Vim's default one second timeout on Escape.  This delay
also disqualifies Escape as the official interface to this feature, but
leave it as a DWIM alternative to CTRL-D for now.

Closes https://github.com/tpope/vim-fugitive/issues/1722
2021-04-01 20:50:34 -04:00
Tim Pope
1d91517cdb Don't discard deleted submodules
There isn't a good command to use for the undo.

References https://github.com/tpope/vim-fugitive/issues/1705
2021-04-01 20:50:34 -04:00