integration: Regenerate conflicted derived files on merge - #1176
Open
ed-irl wants to merge 2 commits into
Open
Conversation
Collaborator
Author
This was referenced May 19, 2026
ed-irl
force-pushed
the
ed-irl/integration-merge-drivers
branch
from
June 2, 2026 20:12
b465e86 to
662e8bb
Compare
ed-irl
force-pushed
the
ed-irl/integration-hooks
branch
2 times, most recently
from
June 2, 2026 22:23
3d69746 to
b244544
Compare
ed-irl
force-pushed
the
ed-irl/integration-merge-drivers
branch
from
June 2, 2026 22:26
662e8bb to
8fa2e91
Compare
ed-irl
force-pushed
the
ed-irl/integration-hooks
branch
from
June 8, 2026 11:15
b244544 to
2ef2338
Compare
ed-irl
force-pushed
the
ed-irl/integration-merge-drivers
branch
from
June 8, 2026 11:15
ab72632 to
bbb1d83
Compare
ed-irl
force-pushed
the
ed-irl/integration-hooks
branch
from
June 12, 2026 20:08
2ef2338 to
f05a942
Compare
ed-irl
force-pushed
the
ed-irl/integration-merge-drivers
branch
from
June 12, 2026 20:08
bbb1d83 to
bced906
Compare
This was referenced Jun 12, 2026
ed-irl
force-pushed
the
ed-irl/integration-hooks
branch
from
June 13, 2026 13:40
f05a942 to
236b9b1
Compare
ed-irl
force-pushed
the
ed-irl/integration-merge-drivers
branch
from
June 13, 2026 13:40
bced906 to
8dfba8a
Compare
ed-irl
force-pushed
the
ed-irl/integration-hooks
branch
from
June 15, 2026 09:53
236b9b1 to
22fa68b
Compare
ed-irl
force-pushed
the
ed-irl/integration-merge-drivers
branch
from
June 15, 2026 09:53
8dfba8a to
e08f418
Compare
ed-irl
force-pushed
the
ed-irl/integration-hooks
branch
from
June 19, 2026 01:07
3825398 to
fb9a0e5
Compare
ed-irl
force-pushed
the
ed-irl/integration-merge-drivers
branch
from
June 19, 2026 01:08
4b4fe32 to
40200ac
Compare
Adds a git-native `regenerate` merge driver that re-runs the
appropriate generator for derived files when they conflict, rather
than picking a side. Picking a side is unsafe here: many of these
files are only PARTIALLY stochastic. Two branches may have added or
changed real structure (a new flag, test case, mock method) on top of
random ID drift, and a blind take-one silently drops the other side's
structural change. Regenerating against the merged source produces
the correct merged output.
Path mappings, in .githooks/merge-regenerate:
- internal/forge/shamhub/testdata/** -> go test -run TestIntegration
./internal/forge/shamhub/ -update
- testdata/help/*.txt -> go test -run TestHelp . -update
- doc/includes/cli-*.md -> mise run generate
- mocks*.go / mock_*.go / mocks.go -> mise run generate
Generators that emit many files in one run are deduped per merge via
a tmp marker keyed by the parent PID, so the shamhub test runs at
most once even if all 47 fixture files in its output set conflict.
`mise run setup` registers the driver locally; .gitattributes
declares the path mappings. No post-merge hook is needed: the
driver handles conflicts directly during the merge.
ed-irl
force-pushed
the
ed-irl/integration-hooks
branch
from
June 24, 2026 01:32
d3de5c3 to
a89d717
Compare
ed-irl
force-pushed
the
ed-irl/integration-merge-drivers
branch
from
June 24, 2026 01:32
42fe375 to
2fe1405
Compare
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.
Adds a git-native
regeneratemerge driver that re-runs theappropriate generator for derived files when they conflict, rather
than picking a side. Picking a side is unsafe here: many of these
files are only PARTIALLY stochastic. Two branches may have added or
changed real structure (a new flag, test case, mock method) on top of
random ID drift, and a blind take-one silently drops the other side's
structural change. Regenerating against the merged source produces
the correct merged output.
Path mappings, in .githooks/merge-regenerate:
./internal/forge/shamhub/ -update
Generators that emit many files in one run are deduped per merge via
a tmp marker keyed by the parent PID, so the shamhub test runs at
most once even if all 47 fixture files in its output set conflict.
mise run setupregisters the driver locally; .gitattributesdeclares the path mappings. No post-merge hook is needed: the
driver handles conflicts directly during the merge.