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

return commit hash for dolt_merge() when --no-ff is not specified #6281

Merged
merged 31 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b2369e4
return commit
Jul 5, 2023
737e526
Merge branch 'main' into james/merge1
Jul 5, 2023
1d492de
return commit on normal merges
Jul 5, 2023
135c024
[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/upda…
jcor11599 Jul 5, 2023
d4da758
use dolt commit type
Jul 5, 2023
b3ec98b
[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/upda…
jcor11599 Jul 5, 2023
06499f7
missed some skips
Jul 5, 2023
e8b4fa1
Merge branch 'james/merge1' of https://github.com/dolthub/dolt into j…
Jul 5, 2023
cdf87cf
[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/upda…
jcor11599 Jul 6, 2023
7a55b04
missed one
Jul 6, 2023
18302b4
Merge branch 'james/merge1' of https://github.com/dolthub/dolt into j…
Jul 6, 2023
d1820fb
also return hash on fastforward merge
Jul 6, 2023
e15a695
???
Jul 6, 2023
e8397d2
[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/upda…
jcor11599 Jul 6, 2023
45d8e66
hopefully all correct now
Jul 6, 2023
b983bd8
Merge branch 'james/merge1' of https://github.com/dolthub/dolt into j…
Jul 6, 2023
3fff703
merge with main
Jul 6, 2023
c8b8a33
[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/upda…
jcor11599 Jul 6, 2023
daa8689
more
Jul 6, 2023
8579a51
prevent panics
Jul 6, 2023
6bfba3e
skipping redundant test
Jul 6, 2023
ef6afec
please be right
Jul 6, 2023
ff345e5
ff returns hash
Jul 7, 2023
aa567ea
fixing integration tests
Jul 7, 2023
cdf61e1
more queries
Jul 7, 2023
add822e
[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/upda…
jcor11599 Jul 7, 2023
c8be060
rewrite using custom validator
Jul 7, 2023
aafeeaa
bump
Jul 7, 2023
e2e6250
[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/upda…
jcor11599 Jul 7, 2023
3219644
bump
Jul 7, 2023
c8811ca
merge with main
Jul 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions go/libraries/doltcore/sqle/dprocedures/dolt_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,16 @@ func performMerge(ctx *sql.Context, sess *dsess.DoltSession, roots doltdb.Roots,
return ws, "", noConflictsOrViolations, threeWayMerge, err
}

var commit string
if !noCommit {
author := fmt.Sprintf("%s <%s>", spec.Name, spec.Email)
commit, _, err := doDoltCommit(ctx, []string{"-m", msg, "--author", author})
commit, _, err = doDoltCommit(ctx, []string{"-m", msg, "--author", author})
if err != nil {
return ws, commit, noConflictsOrViolations, threeWayMerge, fmt.Errorf("dolt_commit failed")
}
}

return ws, "", noConflictsOrViolations, threeWayMerge, nil
return ws, commit, noConflictsOrViolations, threeWayMerge, nil
}

func abortMerge(ctx *sql.Context, workingSet *doltdb.WorkingSet, roots doltdb.Roots) (*doltdb.WorkingSet, error) {
Expand Down
1 change: 1 addition & 0 deletions go/libraries/doltcore/sqle/enginetest/dolt_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -3604,6 +3604,7 @@ var DoltTagTestScripts = []queries.ScriptTest{
},
{
Query: "CALL DOLT_MERGE('v1')",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down
80 changes: 60 additions & 20 deletions go/libraries/doltcore/sqle/enginetest/dolt_queries_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ var MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL DOLT_MERGE('feature-branch', '-m', 'this is a merge', '--commit')",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -635,6 +636,7 @@ var MergeScripts = []queries.ScriptTest{
},
{
Query: "CALL DOLT_MERGE('feature-branch', '-m', 'this is a merge')",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -674,6 +676,7 @@ var MergeScripts = []queries.ScriptTest{
},
{
Query: "CALL DOLT_MERGE('feature-branch', '-m', 'this is a merge')",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -904,6 +907,7 @@ var MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('b1')",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -1144,6 +1148,7 @@ var MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL DOLT_MERGE('right');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -1194,6 +1199,7 @@ var MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL DOLT_MERGE('other');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -1256,6 +1262,7 @@ var MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL DOLT_MERGE('other');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand All @@ -1279,6 +1286,7 @@ var MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL dolt_merge('test');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 1, 0}},
},
{
Expand Down Expand Up @@ -1316,6 +1324,7 @@ var MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL dolt_merge('test');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -1387,6 +1396,7 @@ var MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL dolt_merge('test');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -1426,6 +1436,7 @@ var MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL DOLT_MERGE('right');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -1455,6 +1466,7 @@ var Dolt1MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL DOLT_MERGE('other');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -1514,6 +1526,7 @@ var Dolt1MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL DOLT_MERGE('other');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand All @@ -1540,6 +1553,7 @@ var Dolt1MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL DOLT_MERGE('feature');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -1570,6 +1584,7 @@ var Dolt1MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL DOLT_MERGE('feature');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -1602,6 +1617,7 @@ var Dolt1MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL DOLT_MERGE('feature');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -1632,6 +1648,7 @@ var Dolt1MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL DOLT_MERGE('feature');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -1880,6 +1897,7 @@ var Dolt1MergeScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL DOLT_MERGE('other')",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -2912,6 +2930,7 @@ var MergeArtifactsScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL DOLT_MERGE('right');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down Expand Up @@ -2996,7 +3015,8 @@ var MergeArtifactsScripts = []queries.ScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select count(*) from dolt_constraint_violations;",
Expand Down Expand Up @@ -4122,7 +4142,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select pk, col2 from t;",
Expand Down Expand Up @@ -4150,7 +4171,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select * from t;",
Expand Down Expand Up @@ -4185,7 +4207,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select pk, col11, col2 from t;",
Expand Down Expand Up @@ -4219,7 +4242,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select pk, col1, col2 from t;",
Expand Down Expand Up @@ -4249,7 +4273,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select * from t;",
Expand All @@ -4274,7 +4299,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select * from t;",
Expand All @@ -4299,7 +4325,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select * from t;",
Expand All @@ -4324,7 +4351,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select * from t;",
Expand Down Expand Up @@ -4352,7 +4380,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select * from t;",
Expand All @@ -4378,7 +4407,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select pk, col1, col2 from t;",
Expand Down Expand Up @@ -4414,7 +4444,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
// NOTE: If we can't find an exact tag mapping, then we fall back to
Expand Down Expand Up @@ -4451,7 +4482,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select * from t;",
Expand Down Expand Up @@ -4520,7 +4552,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select * from parent;",
Expand Down Expand Up @@ -4626,7 +4659,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select * from t;",
Expand Down Expand Up @@ -4654,7 +4688,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select * from t;",
Expand Down Expand Up @@ -4744,7 +4779,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
},
},
Expand Down Expand Up @@ -4786,7 +4822,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
},
},
Expand Down Expand Up @@ -4890,7 +4927,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Query: "select * from t order by pk;",
Expand Down Expand Up @@ -5174,7 +5212,8 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
// See the comment above about why this should NOT report a conflict and why this is skipped
Skip: true,
Query: "call dolt_merge('right');",
Expected: []sql.Row{{"", 0, 0}},
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Skip: true,
Expand All @@ -5201,6 +5240,7 @@ var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
SkipResultsCheck: true,
Expected: []sql.Row{{"", 0, 0}},
},
{
Expand Down
Loading