# Allow opening git commit view via URI scheme \(\#43341\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 00ee06137ecda0bc00efce23797711a25990f10f

Requested commit: 00ee06137ecda0bc00efce23797711a25990f10f

Commit: 00ee06137ecda0bc00efce23797711a25990f10f

Tree: cd0729dd4bba1ae525ec0d26e18d3cad22fc970d

Author: peter schilling

Committer: GitHub

## Message

```
Allow opening git commit view via URI scheme  (#43341)

Add support for `zed://git/commit/<path-to-repo>#<sha>` (**EDIT:** now
changed to `zed://git/commit/<sha>?repo=<path>`) URI scheme to access
the git commit view

implement parsing and handling of git commit URIs to navigate directly
to commit views from external links. the main use case for me is to use
OSC8 hyperlinks to link from a git sha into zed. this allows me e.g. to
easily navigate from a terminal into zed

**questions**

- is this URI scheme appropriate? it was the first one i thought of, but
wondering if `?ref=<some sha>` might make more sense – the git/commit
namespace was also an equally arbitrary choice

<details>
<summary>video demo showing navigation from zed's built in
terminal</summary>


https://github.com/user-attachments/assets/18ad7e64-6b39-44b2-a440-1a9eb71cd212
</details>

<details>
<summary>video demo showing navigation from ghostty to zed's commit
view</summary>


https://github.com/user-attachments/assets/1825e753-523f-4f98-b59c-7188ae2f5f19

</details>



Release Notes:

- Added support for `zed://git/commit/<sha>?repo=<path>` URI scheme to
access the git commit view

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
```

## Parents

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

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