Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Data conflict resolution during interactive rebase #8294

Merged
merged 5 commits into from
Aug 29, 2024

Conversation

fulghum
Copy link
Contributor

@fulghum fulghum commented Aug 24, 2024

When data conflicts occur during an interactive rebase, customers can now use Dolt's conflict resolution tools to resolve the conflicts and continue the rebase operation. Note that schema conflicts are not supported yet.

Example:

> select * from dolt_rebase;
+--------------+--------+----------------------------------+----------------------------+
| rebase_order | action | commit_hash                      | commit_message             |
+--------------+--------+----------------------------------+----------------------------+
| 1.00         | drop   | iumpo2t0hd6drcn11jo8osdack1jmafp | inserting row 1 on branch1 |
| 2.00         | pick   | us2uaji20dj77cnf1i2l698itr5392se | updating row 1 on branch1  |
+--------------+--------+----------------------------------+----------------------------+

> call dolt_rebase('--continue');
data conflict detected while rebasing commit us2uaji20dj77cnf1i2l698itr5392se (updating row 1 on branch1). 

Resolve the conflicts and remove them from the dolt_conflicts_<table> tables, then continue the rebase by calling dolt_rebase('--continue')

> select * from dolt_conflicts_t;
+----------------------------------+---------+---------+--------+--------+---------------+----------+----------+-----------------+------------------------+
| from_root_ish                    | base_pk | base_c1 | our_pk | our_c1 | our_diff_type | their_pk | their_c1 | their_diff_type | dolt_conflict_id       |
+----------------------------------+---------+---------+--------+--------+---------------+----------+----------+-----------------+------------------------+
| us2uaji20dj77cnf1i2l698itr5392se | 1       | one     | NULL   | NULL   | removed       | 1        | uno      | modified        | B1dLxGtGIlHRKJo88tigpw |
+----------------------------------+---------+---------+--------+--------+---------------+----------+----------+-----------------+------------------------+

> call dolt_conflicts_resolve('--theirs', 't');
+--------+
| status |
+--------+
| 0      |
+--------+

> call dolt_add('t');

> call dolt_rebase('--continue');
+--------+-----------------------------------------------------+
| status | message                                             |
+--------+-----------------------------------------------------+
| 0      | Successfully rebased and updated refs/heads/branch1 |
+--------+-----------------------------------------------------+

Customer issue: #7820

@dolthub dolthub deleted a comment from coffeegoddd Aug 27, 2024
@fulghum fulghum requested a review from macneale4 August 27, 2024 18:46
Copy link
Contributor

@macneale4 macneale4 left a comment

Choose a reason for hiding this comment

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

There is a lot here. Rebase is complex!

integration-tests/bats/rebase.bats Outdated Show resolved Hide resolved
go/libraries/doltcore/sqle/dprocedures/dolt_rebase.go Outdated Show resolved Hide resolved
go/libraries/doltcore/sqle/dprocedures/dolt_rebase.go Outdated Show resolved Hide resolved
go/libraries/doltcore/sqle/dprocedures/dolt_rebase.go Outdated Show resolved Hide resolved
go/libraries/doltcore/sqle/dprocedures/dolt_rebase.go Outdated Show resolved Hide resolved
@dolthub dolthub deleted a comment from coffeegoddd Aug 28, 2024
@coffeegoddd
Copy link
Contributor

@fulghum DOLT

comparing_percentages
100.000000 to 100.000000
version result total
8a49cd8 ok 5937457
version total_tests
8a49cd8 5937457
correctness_percentage
100.0

@dolthub dolthub deleted a comment from coffeegoddd Aug 29, 2024
Copy link
Contributor

@macneale4 macneale4 left a comment

Choose a reason for hiding this comment

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

LGTM!

              |    |    |                 
             )_)  )_)  )_)              
            )___))___))___)\            
           )____)____)_____)\\
         _____|____|____|____\\\__
---------\                   /---------
  ^^^^^ ^^^^^^^^^^^^^^^^^^^^^
    ^^^^      ^^^^     ^^^    ^^
         ^^^^      ^^^

@fulghum fulghum merged commit b4475a8 into main Aug 29, 2024
20 of 21 checks passed
@tbantle22 tbantle22 deleted the fulghum/rebase branch November 21, 2024 20:58
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