zed/crates
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
..
activity_indicator Fix issues with extension API that come up when moving Svelte into an extension (#9611) 2024-03-22 17:29:06 -07:00
assets Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
assistant Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
audio Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
auto_update markdown preview: highlight code blocks (#9087) 2024-03-12 12:54:12 +02:00
breadcrumbs Encode rem values derived from pixels using rems_from_px (#9367) 2024-03-14 16:39:55 -04:00
call Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
channel Fix issues with extension API that come up when moving Svelte into an extension (#9611) 2024-03-22 17:29:06 -07:00
cli Windows: Enable clippy deny warnings (#9920) 2024-03-28 11:55:35 -04:00
client Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
clock Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
collab Add git blame (#8889) 2024-03-28 18:32:11 +01:00
collab_ui Fix the linux keymap (#9829) 2024-03-26 16:10:09 -07:00
collections Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
color Fix hex_to_hsla inside the color crate (#9412) 2024-03-15 16:58:46 -04:00
command_palette Encapsulate CommandPaletteFilter and CommandPaletteInterceptor (#9402) 2024-03-15 12:37:25 -04:00
command_palette_hooks Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
copilot Improve diagnostic header UI (#9888) 2024-03-27 14:30:27 -07:00
copilot_ui Don't update active completion for editors that are not focused (#9904) 2024-03-28 10:51:55 +01:00
db Fix issues with extension API that come up when moving Svelte into an extension (#9611) 2024-03-22 17:29:06 -07:00
diagnostics Add an animation to the LSP checking indicator (#9463) 2024-03-19 10:16:18 -07:00
editor Add git blame (#8889) 2024-03-28 18:32:11 +01:00
extension Add git blame (#8889) 2024-03-28 18:32:11 +01:00
extension_api Fix issues with extension API that come up when moving Svelte into an extension (#9611) 2024-03-22 17:29:06 -07:00
extension_cli Add git blame (#8889) 2024-03-28 18:32:11 +01:00
extensions_ui Extract Zig support into an extension (#9893) 2024-03-27 20:56:30 -04:00
feature_flags Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
feedback Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
file_finder Fix next/prev shortcuts handling in the File Finder (#9785) 2024-03-25 14:06:37 -07:00
fs Add git blame (#8889) 2024-03-28 18:32:11 +01:00
fsevent Add rs-notify implementation of fs::watch (#9040) 2024-03-08 22:18:44 -08:00
fuzzy Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
git Add git blame (#8889) 2024-03-28 18:32:11 +01:00
go_to_line Restore --all-targets for clippy (#9346) 2024-03-14 12:39:45 -04:00
google_ai Fix licensing errors 2024-03-20 15:52:02 +01:00
gpui Add git blame (#8889) 2024-03-28 18:32:11 +01:00
gpui_macros Fix flickering (#9012) 2024-03-11 10:45:57 +01:00
image_viewer Adjust image viewer tab title font (#9903) 2024-03-28 11:44:15 -04:00
install_cli Fix flickering (#9012) 2024-03-11 10:45:57 +01:00
journal Revert "Revert "chore: Bump Rust version to 1.77 (#9631)"" (#9672) 2024-03-22 11:17:16 +01:00
language Stop reading deserialize_fingerprint (#9668) 2024-03-27 11:24:31 +01:00
language_selector Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
language_tools Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
languages Revert "Add working directories for eslint (#9738)" (#9914) 2024-03-28 15:09:05 +01:00
live_kit_client Add a schema to extensions, to prevent installing extensions on too old of a Zed version (#9599) 2024-03-20 17:33:26 -04:00
live_kit_server Merge prost dependecies (#9522) 2024-03-18 20:33:20 -06:00
lsp windows: Prevent command line from opening in release mode (#9839) 2024-03-27 11:30:23 -07:00
markdown_preview markdown preview: Handle line breaks in between task list items correctly (#9795) 2024-03-26 12:12:57 +02:00
media gpui: Update dependencies (second attempt) (#9836) 2024-03-28 10:22:31 -07:00
menu Fix the linux keymap (#9829) 2024-03-26 16:10:09 -07:00
multi_buffer Enable clippy::never_loop (#9006) 2024-03-14 14:07:50 -04:00
node_runtime Allow extensions to define more of the methods in the LspAdapter trait (#9554) 2024-03-20 12:47:04 -07:00
notifications Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
open_ai Hard code max token counts for supported models (#9675) 2024-03-21 20:30:33 -06:00
outline Restore --all-targets for clippy (#9346) 2024-03-14 12:39:45 -04:00
picker Add tab switcher (#7987) 2024-03-27 11:15:08 -07:00
prettier Fix prettier-plugin-organize-imports plugin removes used imports (#9598) 2024-03-21 08:23:15 +01:00
project Add git blame (#8889) 2024-03-28 18:32:11 +01:00
project_panel Handle first click on Zed window (#9553) 2024-03-25 10:52:18 -07:00
project_symbols Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
quick_action_bar Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
recent_projects chore: Wrap WorkspaceId in newtype (#9492) 2024-03-18 12:39:03 +01:00
refineable Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
release_channel Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
rich_text Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
rope Revert "language: Remove buffer fingerprinting (#9007)" 2024-03-21 14:10:18 -06:00
rpc Add git blame (#8889) 2024-03-28 18:32:11 +01:00
search Support newline and tab literals in regex search-and-replace operations (#9609) 2024-03-25 12:21:04 +01:00
settings Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
snippet Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
sqlez Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
sqlez_macros Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
story Enable clippy::eq_op (#9369) 2024-03-14 17:05:07 -04:00
storybook Fix the linux keymap (#9829) 2024-03-26 16:10:09 -07:00
sum_tree Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
tab_switcher Add tab switcher (#7987) 2024-03-27 11:15:08 -07:00
task Extensions registering tasks (#9572) 2024-03-22 16:18:33 +01:00
tasks_ui Extensions registering tasks (#9572) 2024-03-22 16:18:33 +01:00
telemetry_events Add telemetry events for loading extensions (#9793) 2024-03-25 17:30:48 -04:00
terminal Windows: Enable clippy deny warnings (#9920) 2024-03-28 11:55:35 -04:00
terminal_view Use different icons for terminal tasks (#9876) 2024-03-27 20:49:10 +01:00
text Add git blame (#8889) 2024-03-28 18:32:11 +01:00
theme remoting (#9680) 2024-03-22 08:44:56 -06:00
theme_importer Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
theme_selector Add support for applying theme after extension is installed (#9529) 2024-03-20 11:13:58 -04:00
time_format notification panel: rework time formatting (#8997) 2024-03-12 21:02:04 -06:00
ui Improve diagnostic header UI (#9888) 2024-03-27 14:30:27 -07:00
util Add telemetry events for loading extensions (#9793) 2024-03-25 17:30:48 -04:00
vcs_menu Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
vim vim: Fix t operand not working correctly when cursor is on tag (#9899) 2024-03-28 10:16:54 +01:00
welcome Allow specifying no base keymap (#9471) 2024-03-20 18:52:17 -06:00
workspace workspace: Fix panel resize handles leaking through zoomed panels (#9909) 2024-03-28 12:18:51 +01:00
worktree Add git blame (#8889) 2024-03-28 18:32:11 +01:00
zed Add git blame (#8889) 2024-03-28 18:32:11 +01:00
zed_actions Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00