# Allow viewing past commits in Zed \(\#27636\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 8546dc101dd3984b3e1a51acfbd809e2c8b1f564

Requested commit: 8546dc101dd3984b3e1a51acfbd809e2c8b1f564

Commit: 8546dc101dd3984b3e1a51acfbd809e2c8b1f564

Tree: 7459d793f14db4d133ad94f83f9e6389abacf03a

Author: Max Brunsfeld

Committer: GitHub

## Message

```
Allow viewing past commits in Zed (#27636)

This PR adds functionality for loading the diff for an arbitrary git
commit, and displaying it in a tab. To retrieve the diff for the commit,
I'm using a single `git cat-file --batch` invocation to efficiently load
both the old and new versions of each file that was changed in the
commit.

Todo

* Features
* [x] Open the commit view when clicking the most recent commit message
in the commit panel
  * [x] Open the commit view when clicking a SHA in a git blame column
  * [x] Open the commit view when clicking a SHA in a commit tooltip
  * [x] Make it work over RPC
  * [x] Allow buffer search in commit view
* [x] Command palette action to open the commit for the current blame
line
* Styling
* [x] Add a header that shows the author, timestamp, and the full commit
message
  * [x] Remove stage/unstage buttons in commit view
  * [x] Truncate the commit message in the tab
* Bugs
  * [x] Dedup commit tabs within a pane
  * [x] Add a tooltip to the tab

Release Notes:

- Added the ability to show past commits in Zed. You can view the most
recent commit by clicking its message in the commit panel. And when
viewing a git blame, you can show any commit by clicking its sha.
```

## Parents

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

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