Comments (23)
There is an awesome diffview.nvim. Maybe just integrate this plugin?
from neogit.
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.
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.
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.
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.
Just tried this out and it works really nicely @TimUntersberger thanks for all your hard work on this also @sindrets 🙌🏾
from neogit.
Ah yes (sorry, I am familiar with this feature). Here is the difference:
:Gdiffsplit master
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.
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.
What are the benefits of doing it in the proposed way instead of the existing solution?
from neogit.
What do you mean the existing way?
from neogit.
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.
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.
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.
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.
@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.
@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.
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.
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.
@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.
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.
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.
I've been following diffview closely, I really like the interface! Looking forward to seeing this in neogit :)
from neogit.
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)
- Using the default config from README.md does not work HOT 1
- vim.wait must not be called in a lua loop callback HOT 13
- Open Current Branch in Browser HOT 1
- Using ":Neogit branch" to create a branch leads to error
- Error "Neogit has not been setup!" HOT 2
- Neogit doesn't respond to subcomands
- Error when committing HOT 1
- closing commit_editor with kind = "vsplit" causes error
- Discarding specific lines does not work
- ignored_settings not honoring the `--` flag of the log popup
- Erroneous behavior when working simutaniously with two or more git repos
- Is it possible to disable curosrline highlightings but keep context highlightings?
- unstaging a highlighted section in an staged but untracked file does not work HOT 6
- Float window cannot be split HOT 1
- NeogitWinSeparator has no default highlight
- Vertical split commit popup throws an error when closing or commiting in vsplit
- Tab not focused for secondary git repo the first time Neogit is opened
- Neogit fails to close staged diff split if commit editor is split instead of tab HOT 1
- Async errors + Neogit showing outdated state: neogit/lib/buffer.lua:349: Invalid buffer id: 44 HOT 4
- "Recent commits" section does not show if there are unmerged commits HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neogit.