-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Add rebase with merge commit merge style (#3844) #4052
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9eb247b
add rebase with merge commit merge style (#3844)
apricote ad025d9
Merge branch 'master' into rebase-merge-commit
apricote 5bfe7e4
Merge remote-tracking branch 'origin/master' into rebase-merge-commit
apricote 801decd
fix merge
apricote 9a4aefa
rename MergeStyleRebaseMergeCommit to MergeStyleRebaseMerge
apricote 90a7c96
enable RebaseMerge by default for new repositories
apricote 79ec917
Merge branch 'master' into rebase-merge-commit
apricote 4d8d3e1
enable MergeRebase if all other merge styles are enabled
apricote a910dbb
remove test todo note
apricote b387fc1
Merge branch 'master' into rebase-merge-commit
lunny 35c3a0d
Merge branch 'master' into rebase-merge-commit
apricote 710bc8d
add custom message and set author to user doing merge
apricote 7e74f63
Merge branch 'master' into rebase-merge-commit
apricote 4902ee0
Merge branch 'master' into rebase-merge-commit
lunny a9a8385
Merge branch 'master' into rebase-merge-commit
lafriks 7da356b
Fix migration after conflict
lafriks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| // Copyright 2018 The Gitea Authors. All rights reserved. | ||
| // Use of this source code is governed by a MIT-style | ||
| // license that can be found in the LICENSE file. | ||
|
|
||
| package migrations | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| "code.gitea.io/gitea/modules/util" | ||
|
|
||
| "github.com/go-xorm/xorm" | ||
| ) | ||
|
|
||
| func addPullRequestRebaseWithMerge(x *xorm.Engine) error { | ||
| // RepoUnit describes all units of a repository | ||
| type RepoUnit struct { | ||
| ID int64 | ||
| RepoID int64 `xorm:"INDEX(s)"` | ||
| Type int `xorm:"INDEX(s)"` | ||
| Config map[string]interface{} `xorm:"JSON"` | ||
| CreatedUnix util.TimeStamp `xorm:"INDEX CREATED"` | ||
| } | ||
|
|
||
| sess := x.NewSession() | ||
| defer sess.Close() | ||
| if err := sess.Begin(); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| //Updating existing issue units | ||
| units := make([]*RepoUnit, 0, 100) | ||
| if err := sess.Where("`type` = ?", V16UnitTypePRs).Find(&units); err != nil { | ||
| return fmt.Errorf("Query repo units: %v", err) | ||
| } | ||
| for _, unit := range units { | ||
| if unit.Config == nil { | ||
| unit.Config = make(map[string]interface{}) | ||
| } | ||
| // Allow the new merge style if all other merge styles are allowed | ||
| allowMergeRebase := true | ||
|
|
||
| if allowMerge, ok := unit.Config["AllowMerge"]; ok { | ||
| allowMergeRebase = allowMergeRebase && allowMerge.(bool) | ||
| } | ||
|
|
||
| if allowRebase, ok := unit.Config["AllowRebase"]; ok { | ||
| allowMergeRebase = allowMergeRebase && allowRebase.(bool) | ||
| } | ||
|
|
||
| if allowSquash, ok := unit.Config["AllowSquash"]; ok { | ||
| allowMergeRebase = allowMergeRebase && allowSquash.(bool) | ||
| } | ||
|
|
||
| if _, ok := unit.Config["AllowRebaseMerge"]; !ok { | ||
| unit.Config["AllowRebaseMerge"] = allowMergeRebase | ||
| } | ||
| if _, err := sess.ID(unit.ID).Cols("config").Update(unit); err != nil { | ||
| return err | ||
| } | ||
| } | ||
| return sess.Commit() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.