Skip to content

Report native fast-forward merge outcomes accurately - #7

Open
superlzyguy wants to merge 1 commit into
dolthub:mainfrom
superlzyguy:fix/merge-fast-forward
Open

superlzyguy wants to merge 1 commit into
dolthub:mainfrom
superlzyguy:fix/merge-fast-forward

Conversation

@superlzyguy

Copy link
Copy Markdown

doltMerge() currently returns fast_forward: 0 even when HEAD advances to exactly the incoming commit. Capture the native merge result and report 1 when it equals the resolved merge input. Resolve the source once and merge that immutable hash, so concurrent branch movement cannot change classification; preserve the caller's branch label in the merge commit message.

Adds six tests: true fast-forward, three-way merge, already-up-to-date, fast-forward to a merge commit, quoted branch label, and missing source without a HEAD change.

Provenance:

  • Applies the recorded patch unchanged; SHA256 ad3964c77fd49e153616cec9fd7271060f490e583ee46feec69996483df67964.
  • Recorded patch and historical validation: 135 wrapper tests, direct three-outcome probe, engine merge checks, and deterministic branch-movement probe on the earlier source build.
  • Installed-package diagnostic: node scripts/native-followup-probe.mjs, official 0.50.9, Linux x64, Node 24.21.0, rechecked October 19: headEqualsIncoming=true, engine fastForward=false. Diagnostic exits 1 as intended (it also reproduces an independent native reset defect).

This upstream submission does not change the consumer's official 0.50.9 dependency or publish a fork package.

Fresh Linux x64 validation on upstream base 3c1824d5bf24f1b6c2e681d366fc02a395665809 using the official 0.51.0 release amalgamation, Node 24.21.0 and Bun 1.4.2:

  • npm install --ignore-scripts --package-lock=false, node scripts/download.js, node scripts/build-amalgamation.js, node-gyp rebuild succeeded.
  • bun test test/: 135 pass, 0 fail (6 files, 228 assertions). The checkout contains no prebuilt addon, so tests load build/Release/doltlite.node.
  • Recompiled only the original wrapper source with node-gyp build and reran the same tests: 133 pass, exactly two failures (the two true fast-forward cases). Restored the patch afterward.

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