Skip to content

Codeaucafe/10488 - #10616

Merged
elianddb merged 12 commits into
mainfrom
codeaucafe/10488
Mar 25, 2026
Merged

elianddb merged 12 commits into
mainfrom
codeaucafe/10488

Conversation

@elianddb

@elianddb elianddb commented Mar 2, 2026 •

Copy link
Copy Markdown
Contributor

Companion #10549

Add support for --overwrite-ignore and --no-overwrite-ignore flags to
dolt checkout, matching Git's behavior. By default, ignored tables are
silently overwritten during branch switch (preserving existing
behavior). The new --no-overwrite-ignore flag aborts the checkout if
any ignored tables would be overwritten.

Changes:
- Add flag definitions in flags.go and arg_parser_helpers.go
- Thread overwriteIgnore parameter through SQL procedure call chain
in dolt_checkout.go and dolt_checkout_helpers.go
- Implement FindOverwrittenIgnoredTables() in checkout.go to identify
ignored tables that differ between current working root and target
branch
- Add ErrCheckoutWouldOverwriteIgnoredTables error type
- Add CLI-level mutual exclusivity validation and error handling
- Add 9 BATS integration tests

Note, the implementation handles two checkout paths:
1. With uncommitted changes: check runs via RootsForBranch() during
transferWorkingChanges()
2. Without uncommitted changes: check runs before SwitchWorkingSet()
in MoveWorkingSetToBranch()

Refs: #10488
Fix FindOverwrittenIgnoredTables to correctly handle the case
where an ignored table exists in the working set but not on the
target branch. Before, the function would incorrectly flag
this as an overwrite scenario when using --no-overwrite-ignore. Added
test for this scenario.

Also, used tbl.String() in FindOverwrittenIgnoredTables instead of
tbl.Name for consistent table name formatting in error messaging.

Refs: #10488
Extract repeated ignored table check logic into a helper func. Also,
add more edge case tests. Also improve error message wording and add
code comments explaining the semantics of the
--no-overwrite-ignore flag.

Refs: #10488
Only resolve the target branch head root in the non-move checkout
path when --no-overwrite-ignore is specified. In the default case
(overwrite allowed), the branch head is not needed for the ignored
table check.

Also refactor error message.

Refs: #10488
@coffeegoddd

Copy link
Copy Markdown
Contributor

@elianddb DOLT

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

Move CheckOverwrittenIgnoredTables out of RootsForBranch and
transferWorkingChanges and into MoveWorkingSetToBranch. This keeps
ignored-table logic at correct abstraction level rather than threading
it through low-level root-move helpers. Also, add SQL engine tests to
DoltCheckoutScripts to validate the overwrite-ignore flags through the
SQL procedure path.

Refs: #10488
@coffeegoddd

Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
8acf9fb ok 5937471
version total_tests
8acf9fb 5937471
correctness_percentage
100.0

@coffeegoddd

coffeegoddd commented Mar 3, 2026 •

Copy link
Copy Markdown
Contributor

@elianddb DOLT

test_name from_latency_p95 to_latency_p95 percent_change
tpcc-scale-factor-1 61.08 61.08 0.0
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 c790f75 38.0 dolt 8d123fd 38.37 0.97

Replace the ErrCheckoutWouldOverwriteIgnoredTables plain struct with
a errors.Kind so the test assertion can use ExpectedErr instead of
ExpectedErrStr.

This eliminates the DoltgreSQL incompatibility where the error message
contained schema-qualified table names (e.g. public.ignored_tbl) that
did not match the Dolt-only string. Kind.Is() ignores the formatted
message entirely, making the check engine-agnostic.

Refs: #10488
@coffeegoddd

coffeegoddd commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

@elianddb DOLT

read_tests from_latency to_latency percent_change
covering_index_scan 0.54 0.54 0.0
groupby_scan 9.91 9.91 0.0
index_join 1.82 1.82 0.0
index_join_scan 1.39 1.39 0.0
index_scan 21.89 21.89 0.0
oltp_point_select 0.27 0.27 0.0
oltp_read_only 5.28 5.18 -1.89
select_random_points 0.53 0.53 0.0
select_random_ranges 0.55 0.55 0.0
table_scan 21.89 21.89 0.0
types_table_scan 65.65 66.84 1.81
write_tests from_latency to_latency percent_change
oltp_delete_insert 6.32 6.32 0.0
oltp_insert 3.13 3.13 0.0
oltp_read_write 11.24 11.24 0.0
oltp_update_index 3.19 3.19 0.0
oltp_update_non_index 3.13 3.13 0.0
oltp_write_only 5.99 5.99 0.0
types_delete_insert 6.79 6.79 0.0

@coffeegoddd

Copy link
Copy Markdown
Contributor

@elianddb DOLT

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

@coffeegoddd

Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
8d123fd ok 5937471
version total_tests
8d123fd 5937471
correctness_percentage
100.0

@elianddb
elianddb merged commit 4a9808a into main Mar 25, 2026
51 of 59 checks passed
@tbantle22
tbantle22 deleted the codeaucafe/10488 branch May 20, 2026 20:53
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