Fail amend commits when branch head has moved - #11344
Merged
Merged
Conversation
Contributor
|
@elianddb DOLT
|
Contributor
Contributor
fulghum
approved these changes
Jul 24, 2026
fulghum
left a comment
Contributor
There was a problem hiding this comment.
Looks good! Just a couple small comments to check out. I think testing with ignored tables would be helpful and documenting the expected behavior for ignored files in the code when we do the HEAD check.
Contributor
|
@coffeegoddd DOLT
|
|
@coffeegoddd DOLT
|
|
@coffeegoddd DOLT
|
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.
When a SQL transaction ran
CALL DOLT_COMMIT('--amend')after another connection had added a commit or merged a branch, the amend silently replaced the transactionHEADcommit up to the newHEADcommit. The data from the erased commits survived, but the commit itself, including merge records we're gone.datas.CommitOptions.Amendis replaced withAmendedCommit(hash.Hash), the address of the commit an amend replaces.datas.BuildNewCommitrejects an amend unlessAmendedCommitis still the datasetHEAD, relying on theCAS inCommitWithWorkingSet` for atomic comparison.dsess.doCommitrunsvalidateAmendedHeadbefore the working set merge to specify the head conflict over a row conflict.merge,cherry-pick, in parity withgitandrevert, a Dolt-specific addition because it follows the same merge state.HEADcheck bypass moves from theAmendflag to a new explicitCommitOptions.Forcefield.Fix Potential concurrency Issue with
call dolt_commit('--amend')#9072