gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Side-by-side diff

Open hgezim opened this issue 2 years ago • 11 comments

Is your feature request related to a problem? Please describe.

Any interest in adding a side-by-side diff view?

Describe the solution you'd like

I'm a huge fan of GitUp but can't use it due to my code being on a remote (Linux) machine. Something like this would be great: https://github.com/git-up/GitUp#complete-example-2-gitdiff

hgezim avatar Aug 24 '22 15:08 hgezim

Would love split view of diffs too. This is especially helpful on larger screens.

xJonathanLEI avatar Oct 23 '22 06:10 xJonathanLEI

For sure a thing planned. It will be something I want to tackle by getting rid of using the libgit2 based diffing and basically using a third party crate to do the diffing of arbitrary buffers. like for example difftastic or delta

extrawurst avatar Oct 23 '22 10:10 extrawurst

It would be also great to have ability to move small pieces of diff-code from right to left diff and vice-versa like IntelliJ IDEA does. Very convenient and very rare feature. Screenshot shows this (you can see arrows like >> and << for moving code): ij_compareFiles

rootex- avatar Dec 09 '22 10:12 rootex-

I prefer side by side also. I use it here on GitHub. Minor refactors and deduplications by alexmaco · Pull Request 1411 · extrawurstgitui-07

As for gitui providing an editor to merge from the diff, I think that's out of scope. It's not that rare. Try Diffuse or Meld or Beyond Compare.

joyously avatar Dec 09 '22 17:12 joyously

Have you considered using delta for the side-by-side view?

I like a lot how it looks and I was wondering if is possible to integrate it, or if there is a way to use it with gitui.

https://github.com/dandavison/delta

zrock-dev avatar Feb 14 '23 16:02 zrock-dev

I've checked out delta and also created a feature request there. They offered to use gitui for this:

"Well, the description states that Delta is "a syntax-highlighting pager for git, diff, and grep output". It is not meant to change the code or to stage files. For that purpose, I would suggest GitUI, which is also written in Rust."

Check the response here: https://github.com/dandavison/delta/issues/1305

rootex- avatar Feb 21 '23 13:02 rootex-

@rootex-

Check the response here: dandavison/delta#1305

not sure what you are getting at? its cool it mentions gitui 👍

extrawurst avatar Feb 21 '23 13:02 extrawurst

@rootex-

Check the response here: dandavison/delta#1305

not sure what you are getting at?

@extrawurst I meant a feature that allows to apply hunks in side-by-side diff view (e.g. to apply a hunk from the left pane to the right pane (IntelliJ IDEA UI uses arrow >> for this)), described in this thread:

It would be also great to have ability to move small pieces of diff-code from right to left diff and vice-versa like IntelliJ IDEA does. Very convenient and very rare feature. Screenshot shows this (you can see arrows like >> and << for moving code): 206687098-f7262ef1-38a6-4c9a-b960-7992a2c8afae

Perhaps, I'd better create a separate feature request?

rootex- avatar Feb 21 '23 15:02 rootex-

no need to create a separate ticket. providing a different way to visualise a diff will not change the ways it allows you to stage/unstage/reset changes in it

extrawurst avatar Feb 21 '23 15:02 extrawurst

see https://github.com/extrawurst/gitui/issues/358

extrawurst avatar Mar 04 '23 16:03 extrawurst

vimdiff already has a mature side-by-side diff implementation. Could it be leveraged? It comes with vim so it would be a pretty safe bet to assume it is already installed in a dev/server environment.

cherio avatar Nov 13 '23 18:11 cherio