zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
35.33k stars 1.79k forks source link

Source control view panel #4367

Open aarroisi opened 6 months ago

aarroisi commented 6 months ago

Check for existing issues

Describe the feature

I would like to request a Source Control View, like the one in VSCode where I can see all the changes and staged changes I made in the project. This is very useful for me to review my work before submitting a PR. Maybe you can add a button to open a tab consisting of this information at the bottom left of the screen, right next to the button to open Project Diagnostic. That would be very helpful.

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

Screenshot 2023-11-08 at 10 12 53
Otterpocket commented 6 months ago

Hi, I came from Vscode and heavily relied on the above feature. Since using zed I switched to github desktop and honestly, I feel like my workflow/productivity has improved. Sure the inline diff is essential and some kind of inline blame would be nice. But is version control really the responsibility of the editor? My personal opinion is that I would rather see energy put into things that are clearly the responsibility of the editor.

JosephTLyons commented 6 months ago

Yes! It makes sense we would build out a new panel (a git panel) that lives in one of the docks. We definitely want to support git operations! :)

luwes commented 4 months ago

Please have a look at https://github.com/timbrel/GitSavvy for inspiration if this feature gets implemented. It's the reason I'm still using Sublime Text

coolemur commented 4 months ago

Hi, I came from Vscode and heavily relied on the above feature. Since using zed I switched to github desktop and honestly, I feel like my workflow/productivity has improved. Sure the inline diff is essential and some kind of inline blame would be nice. But is version control really the responsibility of the editor? My personal opinion is that I would rather see energy put into things that are clearly the responsibility of the editor.

Git changes view / diff / cancel, etc operations are definitely something that would prevent me from using Zed.

VScode for example, has decent way to compare / merge changes. Not everything works well there tho, but it greatly improves productivity. (I'm using both Git Desktop + Built in code editor git features just because VSCode Git features isn't enough)

I think this could be selling point of Zed, if Git features would work better than in VSCode, then use of Github Desktop wouldn't be necessary.

vitalics commented 4 months ago

As an extended feature - it would be nice to have a git graph - This is vscode extension but a real game changer and I moved from others git UI's. Simple, intuitive, and powerful.

Graph tree:

image

Context menu:

image

Commit changes:

image
shinebayar-g commented 3 months ago

It looks like Zed already has a partial support for Git.

image

In the editor window, I see a yellow vertical bar for changed lines. In VSCode, this bar is clickable and I could undo or see the exact changes. But in Zed it's non functional.

In the file explorer window, untracked git files appear in green, modified files appear in yellow.

This is my №1 request from Zed editor. Currently using VSCode's Source Control view for reviewing changes.

jasongitmail commented 3 months ago

+ "Stage selected" and "Unstaged selected" commands

jyavorska commented 3 months ago

Curious what others are using in the meantime to have a nice commit review/diff workflow? This is really the one thing preventing me from using Zed as my primary editor, the ability to review diffs in my change, switch branches, make commits, push, etc. is so useful when editing code that it's hard to live without it. Are you just doing everything in the terminal for now?

jasongitmail commented 3 months ago

Curious what others are using in the meantime to have a nice commit review/diff workflow?

I'm keeping the project open in Cursor/VSCode too showing the Source Control view. zed + old IDE. 😆

coolemur commented 3 months ago

Curious what others are using in the meantime to have a nice commit review/diff workflow?

I'm keeping the project open in Cursor/VSCode too showing the Source Control view. zed + old IDE. 😆

Sounds like working on VSCode with extra steps

Otterpocket commented 3 months ago

Curious what others are using in the meantime to have a nice commit review/diff workflow? This is really the one thing preventing me from using Zed as my primary editor, the ability to review diffs in my change, switch branches, make commits, push, etc. is so useful when editing code that it's hard to live without it. Are you just doing everything in the terminal for now?

Github desktop, highly recommend giving it a go

jasongitmail commented 3 months ago

Showing an AI suggested commit message based on contents of the git stage, would be a nice time saver too.

benswift commented 3 months ago

I'm not sure how many Emacs -> Zed converts there are out there, but if Zed had something like Magit I'd jettison my 20 years of dotfiles and muscle memory (well, pinky RSI) in a hot second.

emersonjds commented 3 months ago

@jyavorska yeap, only integrated terminal :S

etiennelacoursiere commented 3 months ago

Never liked the git panel in vscode and was running lazygit in the vscode terminal for a better experience. Doing the same in zed.

jacobtt21 commented 3 months ago

I personally like the git panel, especially the diff view in VSCode. I think adding it to Zed will make it all the more better, just my personal opinion though.

Chimpaya commented 3 months ago

This is the only thing preventing me from leaving VSCode. The lack of Git Panel is a deal breaker. Would love to have it.

texastoland commented 3 months ago

it would be nice to have a git graph - This is vscode extension

I loved this but it's no longer maintained and has since been replaced by GitLens.

Never liked the git panel in vscode and was running lazygit in the vscode terminal for a better experience. Doing the same in zed.

Boosting the workaround in https://github.com/zed-industries/zed/issues/4367#issuecomment-1961591899. There isn't much I miss using https://github.com/jesseduffield/lazygit in Zed. In particular you can drag your terminal to become a full editor tab. It also integrates with https://github.com/dandavison/delta for pretty diffs. Zed 2024-03-03 at 12 15 04@2x

anton-patrushev commented 2 months ago

where is this feature from the timeline or roadmap perspective? Is someone actively working on that or there are things with higher priorities than that one for now?

coolemur commented 2 months ago

it would be nice to have a git graph - This is vscode extension

I loved this but it's no longer maintained and has since been replaced by GitLens.

Never liked the git panel in vscode and was running lazygit in the vscode terminal for a better experience. Doing the same in zed.

Boosting the workaround in #4367 (comment). There isn't much I miss using https://github.com/jesseduffield/lazygit in Zed. In particular you can drag your terminal to become a full editor tab. It also integrates with https://github.com/dandavison/delta for pretty diffs. Zed 2024-03-03 at 12 15 04@2x

Lazygit is cool and all, but this is just a workaround. Which also requires additional tool installation and tiny bit of configuration. This should be built in functionality so when you install Zed, you could use it right away. Most of IDE's and Editors have it built in (VSCode, Intellij for example).

Ph0enixKM commented 2 months ago

What's the progress on this? I think this is the only missing part in the Zed text editor that keeps me using VSC from time to time. I'd like to switch entirely to Zed

julianblanco00 commented 2 months ago

The VS Code features of Source Control, Github Copilot commit generator, changes viewer and usage of Git in the panel are the points that I need in my Zed editor, besides that it's amazing.

smdedar commented 2 months ago

Besides VS Code Zed can inspired from Intellij VSC, I think they have best merge conflict fix UI.

anton-patrushev commented 2 months ago

Besides VS Code Zed can inspired from Intellij VSC, I think they have best merge conflict fix UI.

JetBrains IDE has a way more powerful VSC GUI 💯

wagslane commented 2 months ago

For me this is absolutely huge. My two cents is that I actually don't care about the interactivity of a Git UI in my editor, but being able to view the diffs before committing was a big part of my workflow. I guess also reverting any changes using the UI was a thing I did as well, but not as critical

napalmpapalam commented 2 months ago

Besides VS Code Zed can inspired from Intellij VSC, I think they have best merge conflict fix UI.

VSCode actually has the same feature as in the IntelliJ 3-column merge editor: https://code.visualstudio.com/docs/sourcecontrol/overview#_3way-merge-editor

mrnugget commented 1 month ago

To answer the questions around "is someone working on this?" and timeline: yes, I am working on this. Timeline/sequence is in here: https://github.com/zed-industries/zed/issues/8665 git blame will go out in today's preview release. After that: inline git blame, then git status/commit/...

sheaj98 commented 1 month ago

Curious to see how others are using lazygit with zed. My VSCode workflow was CMD+g g which ran a task that ran lazygit and made the terminal view fullscreen and then quitting lazygit closed that terminal that was spawned. I've been having a hard time getting this to work with the Zed tasks mostly around getting the terminal to full screen when I spawn the task. Anyone have anything like this working?

erzz commented 1 month ago

@sheaj98 - I would love something like that in zed as I used similar in nvim too.

<leader>gg just opened lazygit in full floating window qto exit

Git operations are so fast yet so controlled in that flow. I guess equivalent would be being able to bind a key that:

1: opens a jump terminal 2: maximises it 3: executes any command 4: bonus: closes the terminal when the process for the command ends

antoine-df commented 3 weeks ago

This is the only thing preventing me from leaving VSCode. The lack of Git Panel is a deal breaker. Would love to have it.

Same !

GraphtyLove commented 6 days ago

@sheaj98 - I would love something like that in zed as I used similar in nvim too.

<leader>gg just opened lazygit in full floating window qto exit

Git operations are so fast yet so controlled in that flow. I guess equivalent would be being able to bind a key that:

1: opens a jump terminal 2: maximises it 3: executes any command 4: bonus: closes the terminal when the process for the command ends

That would be an amazing approach actually!

jjf21 commented 3 days ago

Atom's source control is by far the most user friendly. 🙊

AbduRahmanS commented 2 days ago

Is anyone working on this ?

Moshyfawn commented 2 days ago

Is anyone working on this ?

https://github.com/zed-industries/zed/issues/4367#issuecomment-2034410029

erzz commented 2 days ago

Perhaps the functionality is pretty much there....

I added the following task and keybinding to replicate my "vision" above :D

tasks.json

[
  {
    "label": "Open lazygit",
    "command": "lazygit",
    "use_new_terminal": true,
    "allow_concurrent_runs": false,
    "reveal": "always"
  }
]

keymap.json

[
...
// Tasks
  {
    "context": "Workspace",
    "bindings": {
      "space g g": ["task::Spawn", { "lazygit": "Open lazygit" }]
    }
  },
...
]

So whenever I wanna work with lazygit - I simply hit space g g and its right there in a terminal window with focus