Skip to content

git: Add file compare actions for git refs - #56494

Open
nguyenphutrong wants to merge 5 commits into
zed-industries:mainfrom
nguyenphutrong:feature/git-file-compare-view
Open

git: Add file compare actions for git refs#56494
nguyenphutrong wants to merge 5 commits into
zed-industries:mainfrom
nguyenphutrong:feature/git-file-compare-view

Conversation

@nguyenphutrong

@nguyenphutrong nguyenphutrong commented May 12, 2026

Copy link
Copy Markdown
Contributor
Screenshot.2026-05-12.at.12.00.46.mp4

Summary:

  • Added Git sidebar/editor actions to compare the selected file with a branch or commit.
  • Reused the ProjectDiff-style viewer so file compares show base/current context and support existing unified/split controls.
  • Added a Git submenu in the project panel context menu for file history and compare actions.

Tests:

  • cargo fmt --check
  • git diff --check
  • rustup run 1.95.0 cargo check -p git_ui
  • rustup run 1.95.0 cargo check -p project
  • rustup run 1.95.0 cargo check -p project_panel
  • cargo test -p git_ui
  • cargo test -p project_panel
  • ./script/clippy -p git_ui -p project_panel -p git

Suggested .rules additions:

  • In git_ui tests that instantiate ProjectDiff directly, call crate::init(cx) after editor::init(cx) so editor add-ons such as ConflictAddon are registered like runtime.

Release Notes:

  • Added Git actions to compare a file with a selected branch or commit.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 12, 2026
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label May 12, 2026
@nguyenphutrong nguyenphutrong changed the title Add file compare actions for git refs feat(git): add file compare actions for git refs May 12, 2026
@maxdeviant maxdeviant changed the title feat(git): add file compare actions for git refs git: Add file compare actions for git refs May 12, 2026
@ChristopherBiscardi ChristopherBiscardi added the area:integrations/git Git integration feedback label May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:integrations/git Git integration feedback cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants