# Add \`git blame\` \(\#8889\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7f5493532421a7c7a1d35dace83206fa9bbb90a0

Requested commit: 7f5493532421a7c7a1d35dace83206fa9bbb90a0

Commit: 7f5493532421a7c7a1d35dace83206fa9bbb90a0

Tree: 78bf7231af4d650245741f023cac2be5da9e37f1

Author: Thorsten Ball

Committer: GitHub

## Message

```
Add `git blame` (#8889)

This adds a new action to the editor: `editor: toggle git blame`. When
used it turns on a sidebar containing `git blame` information for the
currently open buffer.

The git blame information is updated when the buffer changes. It handles
additions, deletions, modifications, changes to the underlying git data
(new commits, changed commits, ...), file saves. It also handles folding
and wrapping lines correctly.

When the user hovers over a commit, a tooltip displays information for
the commit that introduced the line. If the repository has a remote with
the name `origin` configured, then clicking on a blame entry opens the
permalink to the commit on the code host.

Users can right-click on a blame entry to get a context menu which
allows them to copy the SHA of the commit.

The feature also works on shared projects, e.g. when collaborating a
peer can request `git blame` data.

As of this PR, Zed now comes bundled with a `git` binary so that users
don't have to have `git` installed locally to use this feature.

### Screenshots

![screenshot-2024-03-28-13 57
43@2x](https://github.com/zed-industries/zed/assets/1185253/ee8ec55d-3b5e-4d63-a85a-852da914f5ba)

![screenshot-2024-03-28-14 01
23@2x](https://github.com/zed-industries/zed/assets/1185253/2ba8efd7-e887-4076-a87a-587a732b9e9a)
![screenshot-2024-03-28-14 01
32@2x](https://github.com/zed-industries/zed/assets/1185253/496f4a06-b189-4881-b427-2289ae6e6075)

### TODOs

- [x] Bundling `git` binary

### Release Notes

Release Notes:

- Added `editor: toggle git blame` command that toggles a sidebar with
git blame information for the current buffer.

---------

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
Co-authored-by: Mikayla <mikayla@zed.dev>
```

## Parents

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

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