zed icon indicating copy to clipboard operation
zed copied to clipboard

Add a diff view

Open hferreiro opened this issue 2 years ago • 25 comments

Check for existing issues

  • [X] Completed

Describe the feature

Add support for showing the diff between different files, similarly to VSCode's code -d/--diff.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

hferreiro avatar Aug 23 '23 09:08 hferreiro

I would love it too. Zed is a great editor. Lately I've been using it as a terminal app (a window with just center terminal views) and it works fantastic too. A proper git support and I can have everything in one application.

dangh avatar Aug 23 '23 17:08 dangh

Hi! I found a great article to have a feature near to what you want : https://spin.atomicobject.com/fuzzy-find-git-add/

TLDR: use fzf to list changed files and add them to the git HEAD

Try the following command : git ls-files -m -o --exclude-standard | fzf -m --print0 | xargs -0 -o -t git add

Spoutnik97 avatar Jan 29 '24 14:01 Spoutnik97

Any progress or ETA to start working on this?

alioshr avatar Feb 26 '24 14:02 alioshr

While adding a diff viewer, might be nice to add some sort of git quick ui actions somewhere, I love that in vscode I don't have to open up a terminal to push my changes to the remote. Also as many stated, new files and folder highlight would be nice.

savoygrizzly avatar Feb 28 '24 16:02 savoygrizzly

While adding a diff viewer, might be nice to add some sort of git quick ui actions somewhere, I love that in vscode I don't have to open up a terminal to push my changes to the remote.

There's a separate feature request for the source control panel #4367

Also as many stated, new files and folder highlight would be nice.

I believe the basic highlighting of committed vs new files and folders is already in the latest Zed build.

Moshyfawn avatar Feb 28 '24 17:02 Moshyfawn

It doesnt seem to work with nested git (say I have a root docker composer with 2 folders for services each tracked independently), it will only track newly created files for the top level git.

Nevertheless I just switched from vscode, love what you've been doing and even on a big machine you can feel the responsiveness difference. Awesome job guys !

savoygrizzly avatar Feb 28 '24 21:02 savoygrizzly

It doesnt seem to work with nested git (say I have a root docker composer with 2 folders for services each tracked independently), it will only track newly created files for the top level git.

I believe it's tracked in #8275.

Nevertheless I just switched from vscode, love what you've been doing and even on a big machine you can feel the responsiveness difference. Awesome job guys !

💜

Moshyfawn avatar Feb 28 '24 21:02 Moshyfawn

Pumping this again. The only thing keeping me from switching is the lack of git diff UI, like in VSCode. Would love to have it.

Chimpaya avatar Mar 01 '24 10:03 Chimpaya

@Chimpaya to clarify: what do you mean with git diff UI exactly? That you can click on a modified file and see a diff of changes in current branch, or the ability to open any diff/patch and have it properly formatted? (I know that this question sounds like it has an obvious answer, but I do think there's some nuance here)

mrnugget avatar Mar 04 '24 11:03 mrnugget

@Chimpaya to clarify: what do you mean with git diff UI exactly? That you can click on a modified file and see a diff of changes in current branch, or the ability to open any diff/patch and have it properly formatted? (I know that this question sounds like it has an obvious answer, but I do think there's some nuance here)

I mean a built-in source control panel like they have in VScode.

Chimpaya avatar Mar 04 '24 11:03 Chimpaya

I mean a built-in source control panel like they have in VScode.

This is a different feature you're describing, which is discussed in #4367.

Moshyfawn avatar Mar 04 '24 14:03 Moshyfawn

@mrnugget

[the ability to] click on a modified file and see a diff of changes in current branch

This is what I'm looking for and is probably the only thing keeping me from switching to Zed from VSCode.

wescopeland avatar Mar 04 '24 14:03 wescopeland

@Chimpaya to clarify: what do you mean with git diff UI exactly? That you can click on a modified file and see a diff of changes in current branch, or the ability to open any diff/patch and have it properly formatted? (I know that this question sounds like it has an obvious answer, but I do think there's some nuance here)

I would also like to be able to compare any two files, or even two unsaved windows/tabs. Sometimes I paste some content into VSCode in two separate tabs and use its diff view to view what's different between them.

jimmycallin avatar Mar 04 '24 14:03 jimmycallin

I recommend referencing IntelliJ's Git diff, the best I've seen.

SichangHe avatar Mar 05 '24 06:03 SichangHe

Pumping this again. The only thing keeping me from switching is the lack of git diff UI, like in VSCode. Would love to have it.

I'm currently using this as a workaround: https://github.com/extrawurst/gitui

GHxXMgkXgAAVVoA

zarifpour avatar Mar 05 '24 07:03 zarifpour

An alternative to your proposition : https://github.com/bigH/git-fuzzy to combine with delta : https://github.com/dandavison/delta

Spoutnik97 avatar Mar 05 '24 11:03 Spoutnik97

The Git diff and general integration could be better, I can see that as one of the major reasons people will keep using vscode. I ended up using the official GitHub Desktop app to be able to have an overview of changes made (files edited, files added, files removed). Having some sort of UI for that like vscode does really is a necessity.

savoygrizzly avatar Mar 06 '24 21:03 savoygrizzly

I loved how Atom handled the git stuff - commit, amend, push and so on. I just can't get used to how vscode does it.

mkismy avatar Mar 12 '24 06:03 mkismy

I would love to see this to resolve conflicts: https://www.jetbrains.com/help/webstorm/resolving-conflicts.html#distributed-version-control-systems

krisidmisso avatar Mar 15 '24 20:03 krisidmisso

While I definitely support the feature request for a diff function, it will not be sufficient alone to provide a useful version control experience. One would also need branching, staging, committing, pushing, pulling, resolving merge conflicts, history and more.

What I really like about Intellij is its three-way merge panel for resolving conflicts.

htor avatar Mar 17 '24 21:03 htor

Just in case some of you haven't seen it, here's the tracking issue for git integration: https://github.com/zed-industries/zed/issues/8665

mrnugget avatar Mar 18 '24 08:03 mrnugget

I am currently using lazygit.

lazygit

saxenanickk avatar Apr 04 '24 11:04 saxenanickk

Me and the homies waiting for diff view to drop to finally ditch VSCode

image

debkanchan avatar May 03 '24 11:05 debkanchan

I ditched vscode, but It makes me sad to have to open it to get an editable diff view for conflicts.

Zed guys you gotta pick up the pace, zed needs qol's asap.

savoygrizzly avatar May 04 '24 22:05 savoygrizzly

Zed really needs this feature. Just look at how VS Code handles the diffs.

asesh avatar May 21 '24 13:05 asesh

Diff/merge view/editor would be nice.

While we're at it, could I suggest getting a leg up on all the other editors in this department and making use of semantic diff as implemented by Difftastic for example?

I use it all the time on terminal and it is just incredibly useful!

luolong avatar May 28 '24 06:05 luolong

While we're at it, could I suggest getting a leg up on all the other editors in this department and making use of semantic diff as implemented by Difftastic for example?

Be sure to +👍 this other issue 😉

  • #9721

Moshyfawn avatar May 28 '24 15:05 Moshyfawn

If there was a git diff view this would 100% be my main editor.

Sam-Archie avatar Jun 14 '24 14:06 Sam-Archie

Any update on this?

nesrve avatar Jun 17 '24 15:06 nesrve

Any update on this?

https://github.com/zed-industries/zed/issues/8665#issuecomment-2159238068

Moshyfawn avatar Jun 17 '24 16:06 Moshyfawn