fix: disable external diff drivers in workspace patch generation#484
Merged
fix: disable external diff drivers in workspace patch generation#484
Conversation
git diff --binary does not disable external diff drivers. If a user has GIT_EXTERNAL_DIFF or diff.external configured, the patch output is in a non-unified-diff format that git apply silently accepts (with --allow-empty) but applies zero hunks. Adding --no-ext-diff forces git's internal diff engine regardless of user configuration. Made-with: Cursor
goller
approved these changes
Apr 15, 2026
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.
Summary
Workspace patches generated by
depot ci runcould silently contain non-diff content when a user has an external diff driver configured, causing all local actions to be invisible at compile and runtime.What was happening
git diff --binarydoes not disable external diff drivers (GIT_EXTERNAL_DIFFenv var ordiff.externalin gitconfig). If a user has one configured (e.g.difft,delta, or a custom viewer), the diff output is in whatever format that tool produces instead of unified diff. This non-diff content gets uploaded to the cache, and thengit apply --allow-emptysilently succeeds with zero hunks applied — so.depot/files are never materialized on disk.What happens now
Added
--no-ext-diffto thegit diffcommand indetectPatch(), which forces git's internal diff engine regardless of user configuration.GIT_EXTERNAL_DIFFsetaction manifest not foundMade with Cursor
Note
Low Risk
Single flag change to patch generation; low blast radius and primarily improves determinism of
git diffoutput.Overview
Fixes workspace patch generation for
depot ci runby forcing Git’s built-in diff output:detectPatch()now runsgit diff --binary --no-ext-diffso user-configured external diff drivers can’t replace the unified diff content that gets uploaded/applied.Reviewed by Cursor Bugbot for commit a55ff39. Bugbot is set up for automated code reviews on this repo. Configure here.