Skip to content

git: Retain "since" diffs in the GitStore#47619

Merged
cole-miller merged 2 commits intomainfrom
retain-oid-diffs
Jan 27, 2026
Merged

git: Retain "since" diffs in the GitStore#47619
cole-miller merged 2 commits intomainfrom
retain-oid-diffs

Conversation

@cole-miller
Copy link
Member

This PR makes it so that open_diff_since, as used by the branch diff, is able to return a stable diff entity instead of creating a new one every time this is called. In particular, the base text buffer for this diff is now stable across branch diff refreshes, making it usable with the side-by-side view. The strategy for keeping the diff entities alive is the same one that we use for the uncommitted and unstaged diffs--the GitStore only holds a weak pointer to each "since" diff, so when these diffs are no longer in use by the branch diff multibuffer they can be cleaned up.

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 26, 2026
@cole-miller cole-miller merged commit 786b17d into main Jan 27, 2026
27 checks passed
@cole-miller cole-miller deleted the retain-oid-diffs branch January 27, 2026 04:35
cole-miller added a commit that referenced this pull request Feb 4, 2026
#48388)

This regressed in #47619 -- previously we would throw away and reopen
the diffs used to construct the branch diff pretty eagerly, and as a
result the branch diff would update itself when you committed or
switched branches. We inadvertently lost that when we switched to
retaining those diffs in the git store.

Release Notes:

- N/A
adb-sh pushed a commit to adb-sh/zed that referenced this pull request Feb 5, 2026
zed-industries#48388)

This regressed in zed-industries#47619 -- previously we would throw away and reopen
the diffs used to construct the branch diff pretty eagerly, and as a
result the branch diff would update itself when you committed or
switched branches. We inadvertently lost that when we switched to
retaining those diffs in the git store.

Release Notes:

- N/A
rtfeldman pushed a commit that referenced this pull request Feb 5, 2026
#48388)

This regressed in #47619 -- previously we would throw away and reopen
the diffs used to construct the branch diff pretty eagerly, and as a
result the branch diff would update itself when you committed or
switched branches. We inadvertently lost that when we switched to
retaining those diffs in the git store.

Release Notes:

- N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant