Repository navigation
Conversation
3 of 6 tasks
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.
Issue for this PR
Closes #27276
Type of change
What does this PR do?
On Windows, the Review window and Changes tab show many files as "Modified" even though they have no actual content changes. Two root causes in the hardcoded git config (
packages/opencode/src/git/index.ts):core.autocrlf=falseconflict — Windows defaults tocore.autocrlf=true, which converts LF→CRLF on checkout. The VCS layer overrides this tofalse, sogit diffcompares CRLF working trees against LF repository blobs literally, marking every text file as modified.core.symlinks=trueon a non-symlink filesystem — There are 62 symlink files in the repository. Windows does not natively support symlinks, so they are checked out as regular files. Forcingcore.symlinks=truemakesgit diffdetect these as type changes (T) and report them as modified.Fixes:
git/index.ts: Remove-c core.symlinks=truefrom the config array so git uses the platform default (trueon macOS/Linux,falseon Windows). Add--ignore-cr-at-eolto all 6git diffcommands so git ignores carriage-return at end-of-line during comparison.file/index.ts: Add--ignore-cr-at-eolto the twogit diffcommands used by the file tree Changes tab (diff --numstat HEADanddiff --name-only --diff-filter=D HEAD), which run independently of the git layer's config.How did you verify your code works?
--ignore-cr-at-eol, only genuinely changed files show. Confirmed by comparinggit diff --name-status HEADoutput with and without the flag — the file count dropped from hundreds to single digits on a Windows machine withcore.autocrlf=true.git -c core.symlinks=true diff --name-status HEADlisted all 62 symlink files as type changes (T). After removing the override, only actually modified files (like the replacedicon.png) appear.sdks/vscode/images/icon.pngand confirmed the change shows correctly — binary file modifications are not affected by either fix.core.symlinksdefaults totrueon macOS/Linux, so removing the override has zero effect there.--ignore-cr-at-eolis a no-op on platforms without CRLF working trees.Screenshots / recordings
N/A — this is a git layer logic fix, not a UI change.
Checklist