Closed rbong closed 1 year ago
Thanks, look like the bottleneck is Git diff HEAD commit
. It's not relate to flog.
@kevinhwang91 sorry I wasn't more clear, it's a little bit related to Flog, as :Git!
causes the command to load instantly, and previously :Floggit
had no way to use :Git!
.
Fixing this had a cascading effect on changing the API. I wanted to make these changes anyways.
:Floggit
has new flags:
-f
/--focus
causes the window to keep focus-u
/--update
updates the graph buffer after the command is done-t
/--tmp
opens the command in a temporary window:Floggit!
no long opens the command in a temporary window, since there's now a flag for that. It now calls :Git!
instead, which opens the command in the background.
flog#Exec()
/flog#ExecTmp()
no longer format commands. You can now do that with flog#Format()
.
So you can remap bindings now using this format:
nno ... :<C-U>exec flog#Format("Floggit -f -u -t ...")<CR>
Instead of this:
nno ... :<C-U>call flog#Exec("Floggit ...", 1, 1, 1)<CR>
However I wouldn't change your bindings to use Floggit!
.
I've noticed there are some window bugs in Fugitive.
Also in long commands, it causes a lot of lag while the command is finishing, and it takes a lot longer than not using !
.
At least it's possible now, and I got to make some changes I wanted to make.
exec flog#Format('vertical belowright Floggit -f -u -t diff HEAD %h')
is also slow, does it mean the bottleneck is fugitive?
No, the problem is not Fugitive. The changes were not meant to fix the problem, just make :Git!
and :Floggit!
do the same thing.
Thanks, got it.
I found the culprit is my ftplugin/git.vim
setlocal foldmethod=expr
setlocal foldexpr=DiffFold()
setlocal foldlevel=1
function! DiffFold()
let line = getline(v:lnum)
if line =~# '^\(diff\|index\)' " file
return '0'
elseif line =~# '^--- .*$'
return '>1'
elseif line =~# '^==== .*$'
return '>1'
elseif line =~# '^@@' " hunk
return '>2'
elseif line =~# '^\*\*\* \d\+,\d\+ \*\*\*\*$' " context: file1
return '>2'
elseif line =~# '^--- \d\+,\d\+ ----$' " context: file2
return '>2'
else
return '='
endif
endfunction
It's slow for a large git file.
I don't know if I like that you now have to enter :Floggit -u
to update the buffer. I might make it update the buffer by default and replace the option with one that doesn't update the buffer.
I changed it. Sorry if this is inconvenient.
Changes in arguments to :Floggit
:
--update
/-u
: removed. Updating is now the default behaviour--static
/-s
: new. Prevents the graph buffer from updatingChanges to flog#Exec
/flog#ExecTmp
:
No deprecation warnings because it's still in alpha.
If you're having trouble keeping track of all the changes, I'm keeping the v2 Migration Guide up to date.
Great work on this tool and especially v2. Looking forward to diving ever deeper into the possibilities.
Flog v2 has been merged to the master branch and released.
Unfortunately GitHub has no ways to alias branches, so the v2
branch has been deleted. Please switch back to the master
branch if you were already using it.
For other problems, see this issue or post a new issue.
Requests for changes in v2 and feedback on planned changes welcome.
Major changes:
Deprecations:
Progress:
Prerequisites for finalizing: