rbong / vim-flog

A blazingly fast, stunningly beautiful, exceptionally powerful git branch viewer for Vim/Neovim.
750 stars 22 forks source link

make fugitive command run an update against flog #128

Closed ferdinandyb closed 1 month ago

ferdinandyb commented 2 months ago

First of all: really great plugin, it is pretty essential to my git worklow!

One issue I run into often, is that I always use :G to do all things git related in vim, but then I need to remember to press u in the Flog buffer. It would be great flog would update itself after a fugitive operation. There a FugitiveChanged event flog could use, as far as I understand.

ferdinandyb commented 2 months ago

Small followup: I realize there is :Floggit but it is 7 times as long as :G. Also if you open the fugitive status window and make a commit, it doesn't help if you opened it with Floggit, you still need to manually update the Flog buffer.

TamaMcGlinn commented 2 months ago

autoflog solves this (even if you run git commands outside vim entirely)

ferdinandyb commented 2 months ago

Interesting, so you essentially set up inotify on the repo? Honestly, having an option for that natively might not be a bad idea @rbong! Do I also read it correctly, that you have a hardcoded Flog command started?

TamaMcGlinn commented 2 months ago

Yes, that was just pure laziness. Since you pointed it out, I just fixed that and made :AutoFlog pass on args to Flog.

rbong commented 2 months ago

Might not be a bad feature to merge into Flog. Mostly how it works now is a holdover from when Flog was a lot slower and you'd want some control over when it updates in large repos. I have gotten so used to u, not just from Flog but also from gitv, that I never think about it. But it might be nice as long as it can be turned off.

ferdinandyb commented 2 months ago

@TamaMcGlinn hey, I just saw you've put a considerable effort into tooling around flog and git :) (github search for vim-flog popped up like 6 repos from you)

rbong commented 1 month ago

The update system should now be better (if you follow the happy path), ie if you do an interactive rebase it will now update the window after it's done. Not sure if it impacts any other commands.

Haven't implemented auto-updates yet but I plan to have it in v3.

rbong commented 1 month ago

I added the :Flog -auto-update option for v3/Neovim only.

Neovim can do this out of the box, so no Vim support right now. Sorry. Vim users are being left in the dust a bit, but there's some things we just can't do.

I'm closing this now, please feel free to leave feedback or questions in the v3 issue or start a new issue if you run into any bugs.

ferdinandyb commented 1 month ago
  1. aug. 26. 23:42:14 rbong @.***>:

I added the :Flog -auto-update option for v3/Neovim only.

Neovim can do this out of the box, so no Vim support right now. Sorry. Vim users are being left in the dust a bit, but there's some things we just can't do.

Out of curiosity: what is vim missing for this?

rbong commented 1 month ago

Vim does not have something like vim.uv in Neovim AFAIK so it cannot watch files without installing a third-party dependency. Even if it did, it would probably require recompilation or installing your OS's GVim package (since it comes with more flag support), since Vim is not about to require the inotify package by default because of support reasons, and even if you did that, it would be hacky.

The reason it doesn't have branch highlighting is also because Vim doesn't have nvim_buf_add_highlight. This is monumentally faster than Vim's matchaddpos API, and the only reason there wasn't better highlighting sooner is because I didn't realize it was different at all.