Native Git Support in Zed
zed.dev
zed.dev
If so, would a better workflow not be the editor providing shortcuts to stage/unstage individual lines/hunks (which it can indicate in some state column) and a list of files with unstaged changes (to replace the inevitable `git status`)?
You get the same flexibility of crafting commits, directly from the place you’ve edited the files without having intermediate CLI commands. And all the other niceness of the editor (syntax highlighting etc).
I used `git add -p` until very recently (basically, until we built this feature in Zed). If you're using `add -p` and you notice a problem that you want to fix before committing, you need to go find that same bit of code in your editor, edit the code, then re-start your `add -p`. If you had chosen not to stage some preceding hunks, you need to skip over those again. Also, an editor can just render code much more readably than the git CLI can.
Inside the editor in VSCode I would select a chunk that includes the markers that I want to stage, and stage them deliberately like you do.
For the actual commit often I have to do terminal because VSCode would fail to give me the relevant commit hook error message.
I welcome proper Git support, because it would mean fewer switches between editor and terminal (also the in IDE terminal just doesn't work). I hope they nailed it with the small details like they do for most of the application. I've been using GitX in the past and recently Lazygit as my main Git interface. Especially the line by line staging akin to `git add -p` would be welcome, but I read they are not quiet there yet?
I'm curious if it'l allow a workflow where amending to previous commits is easy. This workflow is really easy in Lazygit (using fixups and autosquash under the hood) and makes organising code into separate topic commits without much additional effort. And since Zed is all on the AI train they might incorporate something like git-absorb to automagically amend small changes into the commits they are related to.
I'd also love if they incorporate a proper overview of the Git tree, currently `tig --all` is my goto for that. Or one that allows you to drag and drop branches and rebases previews like Ungit (https://youtu.be/hkBVAi3oKvo?t=236) as that was the point that Git really started to make sense for me.
Zed seems to have a lot going for it. Though the everpresent AI push has me concerned to invest my time into learning its intricacies, for fear of it devolving into Yep Another AI Editor.