Branch Diff: compare working directory against a selected target branch #54050
Replies: 10 comments 5 replies
-
|
This is sorely needed when working with stacked PRs. Note that github is working on adding better support for this: https://github.github.com/gh-stack/ |
Beta Was this translation helpful? Give feedback.
-
|
This is exactly what I currently need! I hope you'll manage to add this feature |
Beta Was this translation helpful? Give feedback.
-
|
Really want this |
Beta Was this translation helpful? Give feedback.
-
|
+1 for this feature. It's frustrating to not be able to use Zed's awesome diff view except for an extremely narrow use case. |
Beta Was this translation helpful? Give feedback.
-
|
Came here from google searching precisely how to do that in Zed. +1, hope it's implemented soon |
Beta Was this translation helpful? Give feedback.
-
|
We should open issue rather than discussion, top ranking issue will be picked up with higer priority. #5393 |
Beta Was this translation helpful? Give feedback.
-
|
I think someone will have to give this serious consideration. I don't imagine anyone would object to a feature like this—which, in my opinion, should have been integrated into Zed the very day they released the Git interface. +1; there are people who desperately need this (myself included). |
Beta Was this translation helpful? Give feedback.
-
|
the picker is mostly a constructor-immutability thing. probably worth landing that first before the panel/tree/viewed work. |
Beta Was this translation helpful? Give feedback.
-
|
Need this too. There already seems to be a diffing tool for commits in the Graph viewer, but I have to go by commits. |
Beta Was this translation helpful? Give feedback.
-
|
Choosing a base branch in the branch diff view has shipped in Zed Stable v1.4.2! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What are you proposing?
A branch diff view that shows all changes (committed + uncommitted) between the current working directory and a user-selected target branch, fully integrated into the Git Panel.
Key capabilities:
Why does this matter?
No way to review committed changes
Today, the Git Panel only shows uncommitted changes (staged/unstaged vs HEAD). Once changes are committed, they disappear from the panel entirely. There is no way to see the full picture of what a branch has changed. The existing "View Branch Diff" button is very limited: it only appears when there are zero uncommitted changes, it's hardcoded to the default branch, and the diff opens without any file list in the panel.
AI-assisted development workflow
This is becoming a critical gap for AI-assisted workflows. When working with Claude Code (or similar tools), a common workflow is:
Today this is impossible in Zed: once the AI commits, the changes vanish from the Changes panel. There's no way to see the accumulating branch diff, track which files have been reviewed, or navigate the changes. You end up having to use external tools (GitHub PR preview,
git diffin terminal) to review what your AI just wrote -- defeating the purpose of an integrated editor.Stacked branches
With stacked branches / stacked PRs, you need to diff against the parent branch, not
main. If I'm onApproval-Tabwhich extendsApplies-To, I need to see only the delta between these two -- not everything sincemain.What problem does this solve?
Every Git GUI and code review tool (GitHub, GitLab, VS Code GitLens, IntelliJ) lets you choose a base branch for comparison and browse changed files. Zed currently has no equivalent. This feature turns Zed into a capable local code review tool, covering:
Working prototype
I have a working local implementation of this feature (~700 lines across 3 files). I'd be happy to clean it up and open a PR if there's interest.
Files modified:
crates/git_ui/src/project_diff.rs-- Branch picker, diff base selection, inline viewed checkboxcrates/git_ui/src/git_panel.rs-- Git Panel integration, tree view, viewed state trackingcrates/project/src/git_store/branch_diff.rs--merged_file_list()accessor,set_diff_base(),tree_diff()accessorScreenshots:
Beta Was this translation helpful? Give feedback.
All reactions