Exclude binary files from JJ diffs#51
Draft
Copilot wants to merge 3 commits into
Draft
Conversation
Co-authored-by: dikkadev <64754924+dikkadev@users.noreply.github.com>
Co-authored-by: dikkadev <64754924+dikkadev@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Exclude binary files from JJ diff context
Exclude binary files from JJ diffs
Nov 29, 2025
dikkadev
pushed a commit
that referenced
this pull request
Feb 17, 2026
Reviewed both open pull requests: - PR #51 (Exclude binary files from JJ diffs): Approve with suggestions regarding code duplication between get_jj_diff and get_jj_diff_for_files - PR #52 (Bump bytes 1.4.0 -> 1.11.1): Approve, clean dependency bump Both PRs compile, pass all tests, and merge without conflicts. https://claude.ai/code/session_013X1TjpYtSZmktzEX3hkLUJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Binary files in JJ diffs were causing context to become too large for the AI model. This PR filters them out, outputting only a minimal notification line instead of the full binary content.
Changes
is_binary_content()using git's heuristic (null byte check in first 8KB)get_jj_diff()andget_jj_diff_for_files()to skip binary content for added/deleted/modified filesOutput for binary files
Note on file selection
File selection for JJ already exists via
decide_diff_jj()inutil.rs- works identically to Git with--select-filesflag or automatic prompt when token limit exceeded.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.