zed/crates
Alvaro Parker db404fc2e3
git: Add diff view for stash entries (#38280)
Continues the work from #35927 to add a git diff view for stash entries.

[Screencast From 2025-09-17
19-46-01.webm](https://github.com/user-attachments/assets/ded33782-adef-4696-8e34-3665911c09c7)

Stash entries are [represented as
commits](https://git-scm.com/docs/git-stash#_discussion) except they
have up to 3 parents:

```
       .----W (this is the stash entry)
      /    /|
-----H----I |
           \|
            U
```

Where `H` is the `HEAD` commit, `I` is a commit that records the state
of the index, and `U` is another commit that records untracked files
(when using `git stash -u`).

Given this, I modified the existing commit view struct to allow loading
stash and commits entries with git sha identifier so that we can get a
similar git diff view for both of them.

The stash diff is generated by comparing the stash commit with its
parent (`<commit>^` or `H` in the diagram) which generates the same diff
as doing `git stash show -p <stash entry>`. This *can* be
counter-intuitive since a user may expect the comparison to be made
between the stash commit and the current commit (`HEAD`), but given that
the default behavior in git cli is to compare with the stash parent, I
went for that approach.

Hoping to get some feedback from a Zed team member to see if they agree
with this approach.

Release Notes:

- Add git diff view for stash entries
- Add toolbar on git diff view for stash entries
- Prompt before executing a destructive stash action on diff view
- Fix commit view for merge commits  (see #38289)
2025-10-20 11:47:15 -04:00
..
acp_thread clock: Cleanup ReplicaId, Lamport and Global (#40600) 2025-10-20 13:26:20 +02:00
acp_tools Update to acp 0.5 (#40701) 2025-10-20 13:52:05 +00:00
action_log Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
activity_indicator Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
agent clock: Cleanup ReplicaId, Lamport and Global (#40600) 2025-10-20 13:26:20 +02:00
agent_servers Update to acp 0.5 (#40701) 2025-10-20 13:52:05 +00:00
agent_settings settings: Remove unused stream_edits setting in agent (#40640) 2025-10-19 15:52:28 +00:00
agent_ui Reduce display_map snapshot creation (#39354) 2025-10-17 21:56:57 +02:00
ai_onboarding ai onboarding: Add dismiss button to the sign in banner (#40660) 2025-10-20 08:35:28 -03:00
anthropic Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
askpass Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
assets Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
assistant_context clock: Cleanup ReplicaId, Lamport and Global (#40600) 2025-10-20 13:26:20 +02:00
assistant_slash_command Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
assistant_slash_commands Reduce display_map snapshot creation (#39354) 2025-10-17 21:56:57 +02:00
audio Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
auto_update Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
auto_update_helper Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
auto_update_ui Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
aws_http_client Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
bedrock Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
breadcrumbs Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
buffer_diff clock: Cleanup ReplicaId, Lamport and Global (#40600) 2025-10-20 13:26:20 +02:00
call Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
channel clock: Cleanup ReplicaId, Lamport and Global (#40600) 2025-10-20 13:26:20 +02:00
cli Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
client clock: Cleanup ReplicaId, Lamport and Global (#40600) 2025-10-20 13:26:20 +02:00
clock clock: Bump the min collaborator ID (#40694) 2025-10-20 11:59:35 +00:00
cloud_api_client Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
cloud_api_types Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
cloud_llm_client Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
cloud_zeta2_prompt Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
codestral Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
collab clock: Cleanup ReplicaId, Lamport and Global (#40600) 2025-10-20 13:26:20 +02:00
collab_ui Reduce display_map snapshot creation (#39354) 2025-10-17 21:56:57 +02:00
collections Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
command_palette Reduce display_map snapshot creation (#39354) 2025-10-17 21:56:57 +02:00
command_palette_hooks Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
component Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
context_server Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
copilot Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
crashes Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
credentials_provider Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
dap Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
dap_adapters Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
db Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
debug_adapter_extension Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
debugger_tools Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
debugger_ui Reduce display_map snapshot creation (#39354) 2025-10-17 21:56:57 +02:00
deepseek Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
denoise Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
diagnostics Add DelayMs type for settings (#40659) 2025-10-20 04:34:55 +00:00
docs_preprocessor Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
edit_prediction Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
edit_prediction_button Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
edit_prediction_context zeta2: Max retrieved definitions option (#40515) 2025-10-20 15:26:41 +00:00
editor workspace: Add NewFileSplit action with direction (#39726) 2025-10-20 16:01:26 +01:00
eval settings: Remove unused stream_edits setting in agent (#40640) 2025-10-19 15:52:28 +00:00
explorer_command_injector Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
extension Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
extension_api Windows: Fix issues with paths in extensions (#37811) 2025-09-11 13:56:06 -07:00
extension_cli Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
extension_host Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
extensions_ui Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
feature_flags Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
feedback Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
file_finder Reduce display_map snapshot creation (#39354) 2025-10-17 21:56:57 +02:00
file_icons Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
fs fs: Fix RealFs::open_handle implementation for directories on windows (#40639) 2025-10-19 15:25:13 +00:00
fs_benchmarks fs: Reintroduce benchmarks crate (#40689) 2025-10-20 10:30:06 +00:00
fsevent Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
fuzzy Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
git git: Add diff view for stash entries (#38280) 2025-10-20 11:47:15 -04:00
git_hosting_providers Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
git_ui git: Add diff view for stash entries (#38280) 2025-10-20 11:47:15 -04:00
go_to_line Reduce display_map snapshot creation (#39354) 2025-10-17 21:56:57 +02:00
google_ai Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
gpui Fix default window size on small displays (#40398) 2025-10-20 14:09:36 +02:00
gpui_macros Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
gpui_tokio Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
html_to_markdown Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
http_client Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
http_client_tls Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
icons Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
image_viewer image_viewer: Use buffer font in breadcrumbs (#40601) 2025-10-18 22:00:28 -07:00
inspector_ui Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
install_cli Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
journal Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
json_schema_store Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
keymap_editor Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
language clock: Cleanup ReplicaId, Lamport and Global (#40600) 2025-10-20 13:26:20 +02:00
language_extension Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
language_model Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
language_models Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
language_onboarding Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
language_selector Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
language_tools Reduce display_map snapshot creation (#39354) 2025-10-17 21:56:57 +02:00
languages Add comment language injection for supported languages (#39884) 2025-10-20 14:45:51 +02:00
line_ending_selector Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
livekit_api Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
livekit_client Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
lmstudio Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
lsp Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
markdown Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
markdown_preview markdown_preview: Improve the link decoration logic (#39905) 2025-10-17 19:43:44 -03:00
media Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
menu Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
migrator Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
mistral Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
multi_buffer clock: Cleanup ReplicaId, Lamport and Global (#40600) 2025-10-20 13:26:20 +02:00
nc Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
net Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
node_runtime Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
notifications Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
ollama Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
onboarding Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
open_ai Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
open_router Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
outline Reduce display_map snapshot creation (#39354) 2025-10-17 21:56:57 +02:00
outline_panel Reduce display_map snapshot creation (#39354) 2025-10-17 21:56:57 +02:00
panel Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
paths Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
picker Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
prettier Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
project project: Make textDocument/signatureHelp implementation lsp compliant (#40707) 2025-10-20 14:57:23 +00:00
project_benchmarks search: New old search implementation (#39956) 2025-10-20 16:40:02 +02:00
project_panel project_panel: Fix double-click on blank area to create a new file (#40503) 2025-10-18 18:14:41 +05:30
project_symbols Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
prompt_store Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
proto Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
recent_projects Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
refineable Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
release_channel Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
remote remote: Use SFTP over SCP for uploading files and directories (#40510) 2025-10-20 00:01:43 +05:30
remote_server search: New old search implementation (#39956) 2025-10-20 16:40:02 +02:00
repl Reduce display_map snapshot creation (#39354) 2025-10-17 21:56:57 +02:00
reqwest_client Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
rich_text Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
rope Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
rpc Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
rules_library Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
scheduler Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
schema_generator Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
search perf: Add on search + fixups (#40537) 2025-10-17 22:11:09 +00:00
semantic_version Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
session Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
settings Add DelayMs type for settings (#40659) 2025-10-20 04:34:55 +00:00
settings_macros Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
settings_profile_selector Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
settings_ui settings_ui: Use window controls on Linux (#40706) 2025-10-20 20:23:49 +05:30
snippet Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
snippet_provider Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
snippets_ui Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
sqlez Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
sqlez_macros Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
story Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
storybook Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
streaming_diff Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
sum_tree Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
supermaven Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
supermaven_api Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
svg_preview Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
system_specs Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
tab_switcher Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
task Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
tasks_ui Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
telemetry Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
telemetry_events Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
terminal Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
terminal_view terminal_ui: Terminal failed to spawn UI (#40246) 2025-10-19 15:26:41 +01:00
text clock: Cleanup ReplicaId, Lamport and Global (#40600) 2025-10-20 13:26:20 +02:00
theme Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
theme_extension Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
theme_importer Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
theme_selector Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
time_format Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
title_bar Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
toolchain_selector Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
ui Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
ui_input Add DelayMs type for settings (#40659) 2025-10-20 04:34:55 +00:00
ui_macros Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
ui_prompt Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
util Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
util_macros Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
vercel Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
vim Reduce display_map snapshot creation (#39354) 2025-10-17 21:56:57 +02:00
vim_mode_setting Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
watch Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
web_search Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
web_search_providers Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
workspace workspace: Add NewFileSplit action with direction (#39726) 2025-10-20 16:01:26 +01:00
worktree clock: Cleanup ReplicaId, Lamport and Global (#40600) 2025-10-20 13:26:20 +02:00
worktree_benchmarks Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
x_ai Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
zed git: Add diff view for stash entries (#38280) 2025-10-20 11:47:15 -04:00
zed_actions Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
zed_env_vars Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
zeta clock: Cleanup ReplicaId, Lamport and Global (#40600) 2025-10-20 13:26:20 +02:00
zeta2 zeta2: Max retrieved definitions option (#40515) 2025-10-20 15:26:41 +00:00
zeta2_tools zeta2: Max retrieved definitions option (#40515) 2025-10-20 15:26:41 +00:00
zeta_cli zeta2: Max retrieved definitions option (#40515) 2025-10-20 15:26:41 +00:00
zlog Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
zlog_settings Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00