The idea is that g:fugitive_git_command is for user facing commands and
suitable to be changed to something like "hub", while
g:fugitive_git_executable is for low level internals.
If %TEMP% is set to a short path (e.g. "C:\LongDi~1") then tempname()
will return a file name that contains that short path. If that path is
later used as key for entry in s:temp_files dictionary, that entry won't
be found in BufNewFile,BufReadPost events because <afile> is expand()'ed
before it is used as a key for s:temp_files.
In the end, user gets cryptic error message about
"C:\LongDirName\VI12345.tmp.fugitiveblame" not being a git repository
when he tries to open a commit in Gblame window.
To workaround that we expand paths of temp files when adding entries to
s:temp_files. Also, because expand() can't expand short path if it
doesn't exist in the file system, we have to extract the directory part
and expand it separately.
Old behavior: Follow remote/branch to local branch to upstream,
wherever that happens to live.
New behavior: Open branch at remote, without further resolution.
Fixes#871
It is valid - though odd - to open a file at `some//path`. In that case
the current check for fugitive buffers matches and changes &path
unexpectedly. A stricter match against `://` prevents this.
For some locales like de_DE.UTF8 the text of `git status` contains multi-byte characters.
This change allows a subsequent file name to be matched correctly .
This removes the fugitive_utility augroup, and allows for something like
the following:
> vim --cmd 'au User Fugitive Gbrowse!' path/to/file
Without this patch the user's User autocommand would be run before
fugitive's, and therefore the commands would not be defined already.
When using a helper script to make Windows Vim work with Cygwin Git, arguments
containing spaces don't survive being passed through "cmd /c" to this script
and are decomposed into several tokens.
Just use "%x20" instead of spaces in the pretty format to avoid the problem.
If the previous window no longer exists when Gedit is called, the
attempt to change windows with 'wincmd p' fails and 'wincmd w' should be
used instead.
The option `status.showUntrackedFiles=all` used with `git status` for
`:Gstatus` might cause an error, which then causes fugitive to display an
empty status window / index file.
Redirecting the stderr output is useful in this case.
The generated command was:
git --git-dir=/home/user/.dotfiles/.git -c 'status.displayCommentPrefix=true' -c 'color.status=false' -c 'status.short=false' -c 'status.showUntrackedFiles=all' status
The error from git is related to submodules being moved to another
subdirectory, where the relative "gitdir" now does not exist anymore:
fatal: Not a git repository: vim/bundle.old.nobackup/CLEAN/colorscheme-base16/../../../.git/modules/vim/bundle/colorscheme-base16
While that's a Git / user error after all, fugitive should be more
helpful in that case by displaying the error.
It uses the 'shellpipe' setting to detect if '2>&1' is supported (Ref:
https://github.com/tpope/vim-fugitive/pull/661#issuecomment-120438667).
Closes#661.
Closes https://github.com/tpope/vim-fugitive/issues/686
For example, when running:
:Git add %
neovim throws the following exception:
E499: Empty file name for '%' or '#',
only works with ":p:h": terminal git add %
It is a result of the tabnew command, it creates a new blank tab where
"%" is empty.
This commit changes "tabnew" to "tabedit %" so you're still working on
the same file.
Once the command is done running the tab closes.
Previously, if there were untracked files inside an untracked folder,
:Gstatus would only show the new folder. Attempting to run a diff on the
folder would pass the directory name, which would result in Vim opening
a directory listing. This makes :Gstatus list all untracked files, even
if they're inside untracked folders. This requires Git >=1.4, and will
silently fall back to the old behavior on earlier versions.
Closes#605.
This is nothing more than a change in personal preference on my part.
It's particularly annoying when :Gstatus or the quickfix window is the
only other window open.
- Color were causing to appear strange characters in the result.
- These characters made impossible to navigate the results
- The solution was to disable colors while executing git grep
This is more reliable and fixes an issue where the syntastic location
list of the original file would be focused after `:Gdiff`.
Ref: c99f0ff06b (commitcomment-9434351)
* Provide :Gpush, :Gfetch, :Gmerge, and Gpull.
* Use -L to handle :Glog range.
* :Gcommit -v opens message in new tab.
* API for custom :Gbrowse handlers.
* Invoke :Browse if available to open URL.
* Colorize hashes in :Gblame buffer.
* Set cursorbind and nobuflisted in :Gblame buffers.
* :Gblame in blame buffer toggles buffer.
This implements the changes suggested in tpope/fugitive#415.
s:repo_configured_tree is now a global, s:configured_tree() that caches
the bidirectional relation between the worktree and the git_dir.
extract_git_dir() now uses that relation to check whether the
directories it scans are valid worktrees known by the repo at $GIT_DIR.
Taking experimental out of the name, but small tweaks may occur before
then next release.
For future compatibility, any third party handlers should bail and
return an empty string if any of the following are true:
* More than 2 arguments are given.
* The second argument isn't a dictionary.
* The dictionary doesn't contain a "remote" key.
Closes#445.
* <C-R><C-G> in :Gstatus recalls cursor line filename.
* Map dp to show diff in :Gstatus.
* Add ca and cA commit maps to :Gstatus.
* Add cc alias for C in :Gstatus.
* Disable swapfile in :Gstatus.
* Replace :Gstatus cv with cva and cvc.
* Add an `S` mapping for vertical splits from :Gstatus.
* Close diffs when navigating from :Gstatus.
* Enable folding in :Gstatus.
* Accept a count with :Gstatus <C-N>/<C-P>.
* Allow <C-p> pass through to ctrlp.vim in :Gstatus.
* Add . in :Gstatus to prepopulate command line with revision.
* Fix :Gstatus dp with external diff enabled.
* Force displayCommentPrefix to fix :Gstatus on 1.8.5+.
* Support localized `git status`.
* Map g? and <F1> to show help in :Gstatus and :Gblame.
* Kill relativenumber in blame buffer.
* Fix jump to line on reblame.
* Return to blamed buffer on q in blame.
* Restore blamed window on gq in blame.
* Fix :Gblame scrollbind with folds.
* Jump from blame to commit focuses relevant diff.
* :Gblame: Retain original alternate buffer.
* Use - not <CR> for reblame.
* Switch :Gblame <CR> to open commit.
* Open fold when jumping to commit from blame.
* Add maps for resizing blame window.
* Conceal file names and line numbers in :Gblame.
* Set winfixwidth in :Gblame buffers.
* Press <CR> in :Gblame to open commit (reblame is now -).
* Better csh support.
* Work around "always" color option.
* Fix trailing blank line when editing index files.
* Use HTTPS for GitHub URLs in README.
* :Gdiff split direction based on 'diffopt' and window size.
* Focus diff window on :Gdiff.
* Restore options when turning off diff mode.
* Set bufhidden=delete in historical buffers.
* Fix modeline errors in historical buffers.
* Change cp to cP.
* Add :Git! et al. for loading output into a buffer.
* Tab complete Git aliases.
* Enter on a +/- diff line jumps to that line.
* Better Windows support.
* Support core.autocrlf=false on Windows.
* Work around slow \\ Windows network path.
* Work around .git in 'wildignore'.
* Fix garbage during :Gcommit with alternate screen.
* Fix garbling on :Gcommit when nothing is staged.
* Hack around broken :Gcommit with symlinked .git.
* Use y<C-G> to yank the current object's path.
* Preserve alternate file in :Gmove.
* Support bare repositories that don't end in .git.
* Support .git-file repositories (including submodules).
* Support symlinked .git if core.worktree is set.
* Fix redraw issue after :Gbrowse.
* Support GitHub FI in :Gbrowse.
* Support implicit GitHub username in remote for :Gbrowse.
* Make fugitive commands available in nerdtree buffers.
* Make fugitive commands available in command line window.
* :Glgrep and :Gllog.
* :.Glog jumps to same line in each file.
* Map - to go up a directory.
* Provide custom 'foldtext'.
* Respect $GIT_CEILING_DIRECTORIES.
* Look for $GIT_DIR and $GIT_WORK_TREE.
* Improve Windows support.
* Assorted bug fixes.
According to `:help E302`, E302 comes from Vim being unable to rename
the swap file when an open buffer's name is changed; but the error is
mostly harmless. E302 seems to occur in vim-fugitive under Windows but
not *nix.
This fix allow :Glog and :Gdiff to work on such systems; previously the
uncaught error made these operations fail or at least work strangely.