Skip to content

git: Add UI for deleting branches#42703

Merged
kubkon merged 5 commits intozed-industries:mainfrom
errmayank:feat-git-ui-delete-branch
Nov 28, 2025
Merged

git: Add UI for deleting branches#42703
kubkon merged 5 commits intozed-industries:mainfrom
errmayank:feat-git-ui-delete-branch

Conversation

@errmayank
Copy link
Contributor

@errmayank errmayank commented Nov 14, 2025

Closes #42641

WIP for deleting Git branches via UI. Right now it does not handle:

  • Force delete (optional)
  • Remote repositories

Maybe we could also:

  • Show a toast when branch is successfully deleted
  • Handle errors more gracefully

EDIT: outdated - https://github.com/user-attachments/assets/7f84fe94-2f65-46df-8ad8-29e15d8f4fcb

Release Notes:

  • Added UI for deleting Git branches

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 14, 2025
@versecafe
Copy link
Contributor

would it make sense to have a delete button in git: branch that would make it possible to delete multiple branches and consolidate the menus together

@cole-miller
Copy link
Member

cole-miller commented Nov 19, 2025

Thanks! Initial feedback:

  • For discoverability, I think this should probably be integrated into the normal branch list modal, instead of being a separate list where confirming an entry means deleting the branch. We could have an action and a keybinding in the git: branch picker for deleting the selected branch, and add a footer to the modal that makes this discoverable. I don't think we need a separate DeleteBranch action for deploying that modal list.
  • We should use a toast and not an OS notification to alert the user when deleting a branch fails.
  • I think we probably don't need to show a toast when a branch is successfully deleted. Instead, we should just keep the branch list modal open after successfully doing git branch -d and removing that branch from the list. (If git branch -d fails, we should keep it in the list.)
  • For the remote case, looking at how Repository::reset is implemented and following the trail of proto::GitReset is a good way to see how it all fits together. Happy to pair on this as well: https://cal.com/esther-trapadoux-zed/30min

@errmayank
Copy link
Contributor Author

errmayank commented Nov 25, 2025

Thanks for the pointers, I'll check these out.

Happy to pair on this as well

@cole-miller Great! I've booked a session for next Monday this Friday.

@errmayank errmayank force-pushed the feat-git-ui-delete-branch branch 3 times, most recently from d0cd05c to 4b2cc8e Compare November 28, 2025 11:22
kubkon and others added 2 commits November 28, 2025 13:30
Co-authored-by: Mayank Verma <errmayank@gmail.com>
We decoupled `fn show_error_toast` from `GitPanel` as it wasn't required.
Taking `Entity<Workspace>` is enough instead.

Co-authored-by: Mayank Verma <errmayank@gmail.com>
@kubkon kubkon assigned kubkon and unassigned cole-miller Nov 28, 2025
@kubkon kubkon enabled auto-merge (squash) November 28, 2025 12:54
@kubkon kubkon merged commit c18481e into zed-industries:main Nov 28, 2025
24 checks passed
11happy pushed a commit to 11happy/zed that referenced this pull request Dec 1, 2025
Closes zed-industries#42641

Release Notes:

- Added UI for deleting Git branches

---------

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
@JosephTLyons JosephTLyons moved this to 🚢 Shipped by Community in Git board Dec 3, 2025
@franciskafyi franciskafyi moved this from Community PRs to Done in Quality Week – December 2025 Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

Status: 🚢 Shipped by Community

Development

Successfully merging this pull request may close these issues.

Git: UI for deleting branches

4 participants