git.nvim icon indicating copy to clipboard operation
git.nvim copied to clipboard

feature request: View diffs in a new buffer/floating window

Open kagbodji opened this issue 3 years ago • 3 comments

Telescope has this neat feature where it will pop up diffs for the working tree, like so:

image

It would be awesome if your plugin had something similar, for the current buffer.

Use case: during dev, I quickly want to see the changes for the current buffer, against the current index OR against other branches. The telescope approach falls short for me in two places:

  • I have to find the current buffer among other diffs, which is not ideal
  • I don't know/think if it's possible to show a diff against anything other than current HEAD).

What I am looking for is to execute GitDiffView origin/master and get the preview pane Telescope provides as shown in the screenshot. Bonus points if this can be in a floating window. Thanks for this awesome plugin!

kagbodji avatar Dec 18 '22 02:12 kagbodji

Thank you for your suggestion. I understand. You want a feature to compare the current change with other diffs (not only HEAD but another branch or commit).
However, this feature can be achieved via this plugin https://github.com/sindrets/diffview.nvim (I haven't used this plugin before, but I think it satisfies your requirement)

Maybe in the future, I will add your suggestion to my plugin, for now, I want to keep it as simple as possible.

dinhhuy258 avatar Dec 18 '22 04:12 dinhhuy258

Ok, that's fair. I use DiffView currently, and it's neat, except that it manages the entire change set. Usually, I just want to quickly compare the current file I'm working on, which is where git.nvim shines. That said, I agree with you, there are other ways to accomplish this for now, so this has low priority.

kagbodji avatar Jan 11 '23 15:01 kagbodji

Thank you for your understanding. The main reason is that I am quite busy at the moment. Perhaps in the next few months, when I have more time, I will begin to implement that feature on git.nvim. Therefore, let's keep this issue open.

dinhhuy258 avatar Jan 12 '23 03:01 dinhhuy258