Giter Club home page Giter Club logo

Comments (23)

Shatur avatar Shatur commented on June 17, 2024 10

There is an awesome diffview.nvim. Maybe just integrate this plugin?

from neogit.

mjlbach avatar mjlbach commented on June 17, 2024 4

This is how I typically use :Gdiffsplit. The main utility is viewing file diffs against upstream repos, especially when reviewing a PR, where I frequently need to merge changes from the upstream repo before reviewing (or see the difference to know what changed). I made a video to illustrate this (Important part starts around :25):

Screen.Recording.2021-04-11.at.1.30.01.PM.mov

from neogit.

TimUntersberger avatar TimUntersberger commented on June 17, 2024 3

I am trying to talk to @sindrets about a few questions I have to see whether integrating the plugin is possible.

I am also in favor of integrating the plugin instead of writing our own version.

Issue in diffview: #20

from neogit.

TimUntersberger avatar TimUntersberger commented on June 17, 2024 2

One thing which I think has been raised many times in fugitive is the ability to review all changed files i.e. cycle through the diffs natively in fugitive but that was never implemented but would be to me the next logical step since ideally you want to review all the changes in the branch.

This should be easy to add once we have the basic functionality for 1 file.

from neogit.

TimUntersberger avatar TimUntersberger commented on June 17, 2024 2

I created a PR for tracking the process here: #124

It looks like this should be soon ready to merge. The integration works, but it is still a bit slow, because diffview has to redo our calculations ,because it doesn't know about us. We are working on an API that supports providing the diff content ourselves, which will greatly reduce the load time.

from neogit.

akinsho avatar akinsho commented on June 17, 2024 2

Just tried this out and it works really nicely @TimUntersberger thanks for all your hard work on this also @sindrets 🙌🏾

from neogit.

mjlbach avatar mjlbach commented on June 17, 2024 1

Ah yes (sorry, I am familiar with this feature). Here is the difference:

Neogit + tab
image

:Gdiffsplit master

image

I use the second more for comparing across branches/making edits/transferring hunks across branches. No worries if it's not in scope, it's just the only reason I have fugitive installed alongside Neogit 😆

from neogit.

TimUntersberger avatar TimUntersberger commented on June 17, 2024 1

Unrelated but @RianFuro @TimUntersberger do you all actively lurk on our gitter/IRC?

No.

I'm a huge fan of this plugin and would like to make sure we're doing whatever we can in core to support your work.

One thing that still annoys me a bit is that folded text is not highlighted like normal text. More on this can be found in the issue I created.

from neogit.

TimUntersberger avatar TimUntersberger commented on June 17, 2024

What are the benefits of doing it in the proposed way instead of the existing solution?

from neogit.

mjlbach avatar mjlbach commented on June 17, 2024

What do you mean the existing way?

from neogit.

TimUntersberger avatar TimUntersberger commented on June 17, 2024

You can press tab when above a modified file to see the diff of the file like in magit. You can then also stage/unstage/discard a selected part, the hovered hunk or the whole file depending on the position of the cursor (Basically just like in magit).

from neogit.

RianFuro avatar RianFuro commented on June 17, 2024

I do think there's definitely a place for a split diff view in neogit. I don't use it nearly as often as I should, but when I'm inside webstorm I really appreciate it.

This is also the part where we can't really stick to magit since it's extensively using ediff for that, so if fugitive's offering is worth being inspired by, I'm totally game.

from neogit.

TimUntersberger avatar TimUntersberger commented on June 17, 2024

This feature needs some planning in my opinion. I feel like fugitive's version can be improved (though I don't have any concrete prove)

from neogit.

TimUntersberger avatar TimUntersberger commented on June 17, 2024

I played with the native diff viewer a bit and found :diffpatch which could make implementing this a lot easier, but this requires patch to be installed and it looks like windows doesn't have this by default. Does anyone have this exe on windows (Maybe I just deleted it accidently)?

from neogit.

TimUntersberger avatar TimUntersberger commented on June 17, 2024

@mjlbach I am still a bit confused about the workflow. Could you please write about what you would expect the split diff view to support and how you would like to see them realized?

from neogit.

akinsho avatar akinsho commented on June 17, 2024

@TimUntersberger this is also something that keeps me using both fugitive and neogit so thought I'd help regarding a/my workflow if it helps with the implementation.

I personally use it primarily for reviewing PRs or reviewing my current branch against another. The way it works with fugitive is you can run GdiffSplit <target-commit-or-branch> and this will open a full screen 2 way diff of the current file.

For me it's the only way to review changes to a whole file beside another version outside of the browser. The ability to specify a target is also essential IMO since I often need to check the changes against a branch or commit not just vs. the branch I'm on.

It also uses scrollbind which I think is just how vim diff behaves anyway. If it has anymore advanced features than this I don't really use them tbh so maybe someone else can chime in on those. I just think as far as neogit is concerned there's no good way currently to see all the changes in one file in fullscreen given hunks in the status buffer don't apply and are good for a short overview but can't really be used for PR reviews.

One thing which I think has been raised many times in fugitive is the ability to review all changed files i.e. cycle through the diffs natively in fugitive but that was never implemented but would be to me the next logical step since ideally you want to review all the changes in the branch.

Hope this helps.

from neogit.

gennaro-tedesco avatar gennaro-tedesco commented on June 17, 2024

I too fully support the idea of having Gvdiff of some sort. At the moment this is the only reason I have not yet fully replaced fugitive with neogit (and I guess many other users do make use of the diff view, it is in general what git is for, after all).

I understand this is a big shot (and probably available for second iterations) but what could be also ideal would be the possibility to list files that are different between two reviews (perhaps in the quickfix window, for easy navigation and access)?

from neogit.

TimUntersberger avatar TimUntersberger commented on June 17, 2024

I think the first step is for me to complete the diff view of 1 file with sane default keybindings. Afterwards we can easily expand this to multiple files and changing the way the diff is displayed (ex.: instead of floating windows a tab)

from neogit.

TimUntersberger avatar TimUntersberger commented on June 17, 2024

@mjlbach have you checked out the PR yet? The diff view currently is just an alternative to <tab>. The next step would be using the diff to look at a diff between branches. (Maybe this should be a separate popup like in magit)

from neogit.

akinsho avatar akinsho commented on June 17, 2024

I think having a native solution that integrates with the rest of neogit is valuable despite there being another external solution, potentially a neogit native solution can also integrate with the rest of neogit.

Rather having to handle these two things separately if you can then open full screen diffs from neogit hunks or it could integrate with a commit viewer or the log viewer etc. 🤷🏾‍♂️ Also a lot of this work has already been done in #100

from neogit.

Shatur avatar Shatur commented on June 17, 2024

I think having a native solution that integrates with the rest of neogit is valuable despite there being another external solution, potentially a neogit native solution can also integrate with the rest of neogit.

External plugin could be integrated in the same way. Such integration is much easier to maintain. Personally, I don't think it makes sense to reinvent the wheel.
So I decided to suggest the solution.

from neogit.

mjlbach avatar mjlbach commented on June 17, 2024

I've been following diffview closely, I really like the interface! Looking forward to seeing this in neogit :)

from neogit.

Shatur avatar Shatur commented on June 17, 2024

When no item in NeogitStatus is selected then I get an error: E5108: Error executing lua ...onfig/nvim/pack/plugins/opt/neogit/lua/neogit/status.lua:730: attempt to index local 'item' (a nil value)

from neogit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.