Skip to content

dolt revert to more closely match git#11073

Merged
macneale4 merged 2 commits into
mainfrom
macneale4-claude/dolt-revert
May 19, 2026
Merged

dolt revert to more closely match git#11073
macneale4 merged 2 commits into
mainfrom
macneale4-claude/dolt-revert

Conversation

@macneale4
Copy link
Copy Markdown
Contributor

macneale4 added 2 commits May 19, 2026 18:01
Adds two enginetests covering dolt_revert's working-set behavior to
ensure it is the same as git. Tests currently fail.

Related: dolthub/doltlite#961
@coffeegoddd
Copy link
Copy Markdown
Contributor

@macneale4 DOLT

read_tests from_latency to_latency percent_change
covering_index_scan 0.55 0.55 0.0
groupby_scan 9.91 9.73 -1.82
index_join 1.89 1.86 -1.59
index_join_scan 1.34 1.32 -1.49
index_scan 20.74 20.37 -1.78
oltp_point_select 0.26 0.26 0.0
oltp_read_only 5.18 5.18 0.0
select_random_points 0.52 0.52 0.0
select_random_ranges 0.57 0.57 0.0
table_scan 20.74 20.37 -1.78
types_table_scan 45.79 45.79 0.0
write_tests from_latency to_latency percent_change
oltp_delete_insert 6.21 6.21 0.0
oltp_insert 3.02 3.02 0.0
oltp_read_write 11.04 10.84 -1.81
oltp_update_index 3.19 3.13 -1.88
oltp_update_non_index 2.97 2.97 0.0
oltp_write_only 5.77 5.77 0.0
types_delete_insert 6.55 6.55 0.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@macneale4 DOLT

test_name from_latency_p95 to_latency_p95 percent_change
tpcc-scale-factor-1 45.79 44.98 -1.77
test_name from_server_name from_server_version from_tps to_server_name to_server_version to_tps percent_change
tpcc-scale-factor-1 dolt 55dc2b9 52.45 dolt ee3bb2d 52.53 0.15

@coffeegoddd
Copy link
Copy Markdown
Contributor

@macneale4 DOLT

comparing_percentages
100.000000 to 100.000000
version result total
ee3bb2d ok 5937471
version total_tests
ee3bb2d 5937471
correctness_percentage
100.0

Copy link
Copy Markdown
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@macneale4 macneale4 merged commit 34a4e9f into main May 19, 2026
41 of 45 checks passed
timsehn pushed a commit to dolthub/doltlite that referenced this pull request May 20, 2026
…-up)

Dolt 2.0.5 tightened dolt_revert's dirty-set check to match git's
behavior:

  1. Any staged change refuses the revert, even when the staged
     table is unrelated to the revert target. Mirrors git's
     "index must be clean" requirement — otherwise the revert
     commit would mix staged work with the inverse-change commit.
  2. Unstaged changes refuse the revert only if they overlap with
     a table the revert would touch. Disjoint unstaged changes
     are allowed and get folded into the revert commit.

Previous doltlite behavior was "refuse only if dirty change touches
a table the revert would also touch", which allowed staged-disjoint
to proceed. That diverged from Dolt 2.0.5 on
revert_head_staged_unrelated_table_committed (caught by
vc_oracle_revert_test.sh once Dolt was upgraded to 2.0.5).

Replace doltliteRevertHasDirtyTouchedTables /
doltliteCollectRevertTouchedTables / their internal name-list helpers
with a single doltliteRevertCheckDirty that does both checks inline:

  * If session-staged catalog hash differs from session-head hash,
    flag dirty regardless of which tables differ.
  * Else compare working catalog to head; for each differing table,
    check whether the revert target catalog and parent catalog
    differ on that same table — if so, flag dirty.

Error message also updated to match Dolt's:
  "Your local changes would be overwritten by revert.\nhint: ..."

Verified against /tmp/dolt-2.0.5 binary downloaded from the v2.0.5
release:
  * vc_oracle_revert_test.sh: 6/6 pass (was 5/6 with the staged-disjoint
    case failing before this change)
  * vc_oracle_revert_cherrypick_test.sh: 45/45 pass
  * doltlite_merge.sh: 91/91 pass
  * doltlite_conflicts.sh: 40/40 pass
  * doltlite_advanced.sh: 140/140 pass

References: Dolt PR dolthub/dolt#11073 ("dolt revert to more closely
match git") and follow-up commit 014f1d8 ("align revert dirty-set
rules with git") in dolthub/dolt v2.0.5.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants