zed/crates/git/test_data/blame_incremental_not_committed
Thorsten Ball 7f54935324
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>
2024-03-28 18:32:11 +01:00

65 lines
2.0 KiB
Plaintext

0000000000000000000000000000000000000000 4 4 3
author External file (--contents)
author-mail <external.file>
author-time 1710764166
author-tz +0100
committer External file (--contents)
committer-mail <external.file>
committer-time 1710764166
committer-tz +0100
summary Version of file_b.txt from file_b_memory.txt
previous 4aaba34cb86b12f3a749dd6ddbf185de88de6527 file_b.txt
filename file_b.txt
0000000000000000000000000000000000000000 10 10 1
previous 4aaba34cb86b12f3a749dd6ddbf185de88de6527 file_b.txt
filename file_b.txt
0000000000000000000000000000000000000000 15 15 2
previous 4aaba34cb86b12f3a749dd6ddbf185de88de6527 file_b.txt
filename file_b.txt
4aaba34cb86b12f3a749dd6ddbf185de88de6527 4 7 2
author Thorsten Ball
author-mail <mrnugget@gmail.com>
author-time 1710764113
author-tz +0100
committer Thorsten Ball
committer-mail <mrnugget@gmail.com>
committer-time 1710764113
committer-tz +0100
summary Another commit
previous b2f6b0d982a9e7654bbb6d979c9ccb00b1d2e913 file_b.txt
filename file_b.txt
4aaba34cb86b12f3a749dd6ddbf185de88de6527 11 17 2
previous b2f6b0d982a9e7654bbb6d979c9ccb00b1d2e913 file_b.txt
filename file_b.txt
b2f6b0d982a9e7654bbb6d979c9ccb00b1d2e913 6 9 1
author Thorsten Ball
author-mail <mrnugget@gmail.com>
author-time 1710764087
author-tz +0100
committer Thorsten Ball
committer-mail <mrnugget@gmail.com>
committer-time 1710764087
committer-tz +0100
summary Another commit
previous 7aef8a9a211ebc86824769c89f48e4f64aa6183f file_b.txt
filename file_b.txt
b2f6b0d982a9e7654bbb6d979c9ccb00b1d2e913 7 11 2
previous 7aef8a9a211ebc86824769c89f48e4f64aa6183f file_b.txt
filename file_b.txt
e6d34e8fb494fe2b576d16037c61ba9d10722ba3 1 1 3
author Thorsten Ball
author-mail <mrnugget@gmail.com>
author-time 1709299737
author-tz +0100
committer Thorsten Ball
committer-mail <mrnugget@gmail.com>
committer-time 1709299737
committer-tz +0100
summary Initial
boundary
filename file_b.txt
e6d34e8fb494fe2b576d16037c61ba9d10722ba3 9 13 2
filename file_b.txt
e6d34e8fb494fe2b576d16037c61ba9d10722ba3 13 19 1
filename file_b.txt