# git_ui: Pass the clicked ref to git graph custom commands \(\#58781\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/c680755ae06538e81dc618b6b0311a0fcf101d8d)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: c680755ae06538e81dc618b6b0311a0fcf101d8d

Requested commit: c680755ae06538e81dc618b6b0311a0fcf101d8d

Commit: c680755ae06538e81dc618b6b0311a0fcf101d8d

Tree: 1c95c8a9e12edb67cc3f573defc2277524635438

Author: aobat

Committer: GitHub

## Message

```
git_ui: Pass the clicked ref to git graph custom commands (#58781)

Right-clicking a ref label (branch, remote ref, or tag) in the git graph
now opens a ref-specific context menu that resolves custom git commands
with the clicked ref exposed as ZED_GIT_REF, mirroring how VS Code's git
graph offers ref-aware actions. Right-clicking elsewhere on a commit
keeps the existing commit-scoped menu.

<img width="875" height="525" alt="zed (Ubuntu) 2026_06_07 23_26_35"
src="https://github.com/user-attachments/assets/140bdcdf-6536-4b5e-ac2f-9df84f744477"
/>


releated: #55844 #56354


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Added a context menu for ref labels in the git graph that runs custom
git commands with the clicked ref available as `$ZED_GIT_REF`.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
```

## Parents

- [6d42d6228103b0fc4068e08b7acc365b49066984](https://git.cafe/gitcafe/zed/commit/6d42d6228103b0fc4068e08b7acc365b49066984?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/c680755ae06538e81dc618b6b0311a0fcf101d8d?format=markdown)
