Mark generated files with -merge and document regeneration on conflicts#2813
Merged
Conversation
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.
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.
Motivation and Context
PRs that touch
schema/*/schema.tsregularly end up conflicting withmainin 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
mainwith the new attributes in place:schema/draft/schema.tsauto-merged cleanly.schema/draft/schema.jsonanddocs/specification/draft/schema.mdxwere marked conflicted but kept the branch copy with no conflict markers.npm run generatefollowed bygit addresolved 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
-mergeattribute only takes effect for checkouts that already contain the updated.gitattributes.Types of changes
Checklist