sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
3.92k stars 107 forks source link

Viewing fugitive logs within Diffview #427

Closed msvitok77 closed 11 months ago

msvitok77 commented 11 months ago

Hi, is there a possibility to view vim fugitive logs from diffview? I know I can copy commit hash and :DiffviewOpen commithash, but maybe there is a better way similar to neogit integration:

integrations = {
        diffview = true,
    }

Thank you.

sindrets commented 11 months ago

What do you mean exactly by "fugitive logs"? Do you mean the git logs? Specifically the window you get when running fugitive's :Git log command? Describe in detail what you're trying to do.

msvitok77 commented 11 months ago

Hi @sindrets . Sorry for being imprecise. Yes I meant git logs. So doing something like this: 1.) :G log 2.) find some commit I want to view diff for 3.) perform 'some' action to open Diffview (similar to neogit's d command)

sindrets commented 11 months ago

Currently we don't have any integration like this for Fugitive. I have actually implemented what you're describing in my own config, but it's a bit hacky and I just never got around to fixing it up to include it in the plugin.

However, :DiffviewFileHistory is the git-log interface offered by this plugin. You should check it out, and see if it could replace your use of :Git log. At least when you intend to view diffs of the history, as this is what our interface excels at. We support a good number of the git-log command options, and if there's something you're missing: please feel free to open a feature request. Check :h :DiffviewFileHistory for more info.

msvitok77 commented 11 months ago

aaa this is exactly what I need. I'm already using it for a specific file 🤦🏻‍♂️ :DiffviewFileHistory % ... I forgot to check that if no file is provided it works like git log. Thanks! BTW this plugin is really good.

sindrets commented 11 months ago

Great! Closing this issue as solved.