Skip to content

Mark generated files with -merge and document regeneration on conflicts#2813

Merged
dsp-ant merged 1 commit into
mainfrom
generated-files-merge-attrs
May 29, 2026
Merged

Mark generated files with -merge and document regeneration on conflicts#2813
dsp-ant merged 1 commit into
mainfrom
generated-files-merge-attrs

Conversation

@dsp-ant

@dsp-ant dsp-ant commented May 29, 2026

Copy link
Copy Markdown
Member

Motivation and Context

PRs that touch schema/*/schema.ts regularly end up conflicting with main in the generated files (schema.json, docs/specification/*/schema.mdx) — see #2775 for a current example. Git attempts a textual merge of those files and fills them with conflict markers, which invites hand-resolution of content that should only ever be regenerated.

How Has This Been Tested?

Test-merged #2775 into main with the new attributes in place:

  • schema/draft/schema.ts auto-merged cleanly.
  • schema/draft/schema.json and docs/specification/draft/schema.mdx were marked conflicted but kept the branch copy with no conflict markers.
  • Running npm run generate followed by git add resolved the conflict with the correctly regenerated output.

Breaking Changes

None. Note that GitHub still reports such PRs as conflicting until the regenerated files are pushed — that is expected, since the files genuinely need regeneration; this change just makes the local resolution a regenerate-and-commit instead of hand-editing conflict markers. The -merge attribute only takes effect for checkouts that already contain the updated .gitattributes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Generated schema and SEP files (schema.json, schema.mdx, docs/seps/*.mdx)
already carry linguist-generated; add -merge so git keeps the current
branch's copy on merge conflicts instead of inserting conflict markers.
Add a CONTRIBUTING section explaining how to resolve such conflicts by
merging main and regenerating.
@dsp-ant
dsp-ant merged commit cd8def3 into main May 29, 2026
10 checks passed
@dsp-ant
dsp-ant deleted the generated-files-merge-attrs branch May 29, 2026 10:58
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.

1 participant