Skip to content

git: Don't show binary files in past commit view#46312

Merged
cole-miller merged 2 commits intomainfrom
commit-view-binary-files
Jan 8, 2026
Merged

git: Don't show binary files in past commit view#46312
cole-miller merged 2 commits intomainfrom
commit-view-binary-files

Conversation

@cole-miller
Copy link
Member

@cole-miller cole-miller commented Jan 8, 2026

Also improves the commit view to use the same status-based buffer header visual overrides as the project diff as a driveby.

Fixes #45735

Release Notes:

  • git: Binary files are no longer shown in garbled form when viewing an old commit.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 8, 2026
@cole-miller cole-miller merged commit 3835d40 into main Jan 8, 2026
24 checks passed
@cole-miller cole-miller deleted the commit-view-binary-files branch January 8, 2026 03:07

/// Detects if content is binary by checking for NUL bytes in the first 8000 bytes.
/// This matches git's binary detection heuristic.
pub fn is_binary_content(content: &[u8]) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanted to mention

fn analyze_byte_content(bytes: &[u8]) -> ByteContent {
as an alternative.

Would be great to unify the code if this bit gets to evolve some day.

rtfeldman pushed a commit that referenced this pull request Jan 9, 2026
Also improves the commit view to use the same status-based buffer header
visual overrides as the project diff as a driveby.

Fixes #45735

Release Notes:

- git: Binary files are no longer shown in garbled form when viewing an
old commit.
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
Also improves the commit view to use the same status-based buffer header
visual overrides as the project diff as a driveby.

Fixes zed-industries#45735

Release Notes:

- git: Binary files are no longer shown in garbled form when viewing an
old commit.
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
Also improves the commit view to use the same status-based buffer header
visual overrides as the project diff as a driveby.

Fixes zed-industries#45735

Release Notes:

- git: Binary files are no longer shown in garbled form when viewing an
old commit.
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Feb 15, 2026
Also improves the commit view to use the same status-based buffer header
visual overrides as the project diff as a driveby.

Fixes zed-industries#45735

Release Notes:

- git: Binary files are no longer shown in garbled form when viewing an
old commit.
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.

Zed lags/freezes when viewing git diffs that includes images

2 participants