Skip to content

fix(opencode): stabilize git diff patch prefixes#29236

Open
YOMXXX wants to merge 1 commit into
anomalyco:devfrom
YOMXXX:fix/vcs-diff-mnemonic-prefix
Open

fix(opencode): stabilize git diff patch prefixes#29236
YOMXXX wants to merge 1 commit into
anomalyco:devfrom
YOMXXX:fix/vcs-diff-mnemonic-prefix

Conversation

@YOMXXX
Copy link
Copy Markdown

@YOMXXX YOMXXX commented May 25, 2026

Issue for this PR

Closes #29203

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Git's diff.mnemonicprefix=true changes patch headers from the usual a/ and b/ prefixes to contextual prefixes such as c/ and w/. Those patches can fail downstream diff rendering even though the file list is correct.

This PR forces the git patch commands used by OpenCode to emit stable a/ and b/ prefixes without changing the user's repository config. It covers single-file, batched, and untracked patch generation paths.

How did you verify your code works?

  • bun test test/project/vcs.test.ts -t "ignores mnemonic prefix" from packages/opencode
  • bun test test/project/vcs.test.ts from packages/opencode
  • bun typecheck from packages/opencode
  • bun turbo typecheck from the repo root
  • .husky/pre-push

Screenshots / recordings

No UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot render the diff

1 participant