ZIm/crates/collab/src
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
..
api Log when events are written to Clickhouse (#9875) 2024-03-27 12:33:34 -04:00
bin Make it (a tiny bit) easier to run your own collab (#9557) 2024-03-20 21:00:02 -06:00
db Consolidate more extension API structs that were duplicated btwn client and server (#9797) 2024-03-25 21:28:18 -07:00
rpc collab: Bump minimal client version to 0.127.3 (#9649) 2024-03-21 18:23:18 +01:00
tests Add git blame (#8889) 2024-03-28 18:32:11 +01:00
ai.rs Allow AI interactions to be proxied through Zed's server so you don't need an API key (#7367) 2024-03-19 19:22:26 +01:00
api.rs Allow setting a channel for new users to auto-join (#9291) 2024-03-13 11:11:31 -06:00
auth.rs remoting (#9680) 2024-03-22 08:44:56 -06:00
db.rs Add telemetry events for loading extensions (#9793) 2024-03-25 17:30:48 -04:00
env.rs Add an extensions API to the collaboration server (#7807) 2024-02-15 12:53:57 -08:00
errors.rs Remove more unused code related to GitHub auth and errors 2022-04-21 08:57:49 -06:00
executor.rs Remove 2 suffix for collab, rope, settings, menu 2024-01-03 12:29:16 -08:00
lib.rs Fixed channel chat notifications are not working anymore (#9827) 2024-03-26 20:25:09 +01:00
main.rs Windows: Implement signal in collab (#9918) 2024-03-28 11:36:28 -04:00
rate_limiter.rs Allow AI interactions to be proxied through Zed's server so you don't need an API key (#7367) 2024-03-19 19:22:26 +01:00
rpc.rs Add git blame (#8889) 2024-03-28 18:32:11 +01:00
seed.rs Make it (a tiny bit) easier to run your own collab (#9557) 2024-03-20 21:00:02 -06:00
tests.rs Add initial support for defining language server adapters in WebAssembly-based extensions (#8645) 2024-03-01 16:00:55 -08:00