Commit Graph

1990 Commits

Author SHA1 Message Date
Tim Pope
ae6f84adf3 Handle empty items when null splitting
This correctly handles the case of multiple consecutive nulls (which I
don't think Git every produces in practice) and also the case of a bogus
newline at the end (which seems to happen with PowerShell).

References https://github.com/tpope/vim-fugitive/pull/1783
2021-07-04 10:36:49 -04:00
Tim Pope
8e0a8abf08 Don't capture trailing count as part of section header
We don't need this, and it gets in the way.
2021-07-03 06:00:36 -04:00
Tim Pope
ca0ff578ad Move config getter implementation into autoload file 2021-07-03 06:00:36 -04:00
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
9eec18e76b Guard against unloaded plugin in runtime files
This can happen if g:loaded_fugitive is set to disable the plugin, or in
a botched install.
2021-05-31 11:54:04 -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
0868c30cc0 Tighten up diff highlighting
Closes https://github.com/tpope/vim-fugitive/issues/1747
2021-05-12 13:50:44 -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
Faisal Shah
8f4a23e663 Fix capitalization 2021-04-23 16:22:00 -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
55e9f2f47e Fix README formatting 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
Rajit Banerjee
f037ce631a Add note about :Gvdiffsplit 2021-04-16 09:27:16 -04:00
Tim Pope
f5451e4379 fugitive.vim 3.3
* Replace :! :Git backend with smart job runner.
* Replace special cased commit/revert/rebase/merge/etc. with regular :Git.
* Support :Git -c config.name=value and other common flags.
* Improve completion of :Git subcommands, including hiding plumbing commands.
* Improve completion of arguments to :Git subcommands.
* Show unpulled and unpushed sections for both upstream and push remote.
* Introduce capitalized naming scheme for :GMove/:GRename/:GRemove/:GDelete/:GBrowse.
* Expand SSH host aliases in remote URLs for :GBrowse.
* Enable opening arbitrary URLs with :GBrowse.
* Add warnings to deprecated commands.
* Remove all other temp buffer commands in favor of :Git --paginate.
* Don't automatically invoke :setlocal foldmethod=syntax in Fugitive buffers.
* Support colored :Git blame commits in 256 color terminals.
* Bug fixes.
v3.3
2021-04-15 12:15:38 -04:00
Tim Pope
0365bcd76e Provide FugitiveConfigGetRegexp()
This is intended to double as way to check for the presence of any other
Fugitive 3.3 feature.
2021-04-15 10:15:29 -04:00
Tim Pope
2165884d13 Provide FugitiveResult() 2021-04-15 10:15:29 -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
d4e8c29084 Account for invalid b:git_dir in FugitiveGitDir()
The "fugitive:" variant was set by a naive regexp in ftplugin/git*.vim
until a relatively recent fix.
2021-04-13 03:37:30 -04:00
Tim Pope
ae45609cfc Proactively detect Git dir if autocommand hasn't triggered
This is a little clunky, but enabling !empty(FugitiveGitDir()) to work
in autocommands that trigger before ours should provide an acceptable
replacement for the "User Fugitive" event and will hopefully enable us
to unltimately eliminate preemptive detection entirely.
2021-04-12 14:32:10 -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
47479a6cc2 Add :Glog and :Gstatus to list of opt-out legacy commands 2021-04-12 12:03:12 -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