diff options
author | Chris Copeland <chris@chrisnc.net> | 2024-02-12 14:37:23 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-12 23:37:23 +0100 |
commit | 47b59658629f47e0ac559559a305b867740cae9c (patch) | |
tree | 5bc0102a155565f1b813609082d9ae23712e0d65 /modules/structs | |
parent | f9c3459831659d37fd885dd1a9db32dcf19420e4 (diff) | |
download | gitea-47b59658629f47e0ac559559a305b867740cae9c.tar.gz gitea-47b59658629f47e0ac559559a305b867740cae9c.zip |
Add merge style `fast-forward-only` (#28954)
With this option, it is possible to require a linear commit history with
the following benefits over the next best option `Rebase+fast-forward`:
The original commits continue existing, with the original signatures
continuing to stay valid instead of being rewritten, there is no merge
commit, and reverting commits becomes easier.
Closes #24906
Diffstat (limited to 'modules/structs')
-rw-r--r-- | modules/structs/repo.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/structs/repo.go b/modules/structs/repo.go index 51e175fba8..56d6158bd8 100644 --- a/modules/structs/repo.go +++ b/modules/structs/repo.go @@ -98,6 +98,7 @@ type Repository struct { AllowRebase bool `json:"allow_rebase"` AllowRebaseMerge bool `json:"allow_rebase_explicit"` AllowSquash bool `json:"allow_squash_merge"` + AllowFastForwardOnly bool `json:"allow_fast_forward_only_merge"` AllowRebaseUpdate bool `json:"allow_rebase_update"` DefaultDeleteBranchAfterMerge bool `json:"default_delete_branch_after_merge"` DefaultMergeStyle string `json:"default_merge_style"` @@ -195,6 +196,8 @@ type EditRepoOption struct { AllowRebaseMerge *bool `json:"allow_rebase_explicit,omitempty"` // either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. AllowSquash *bool `json:"allow_squash_merge,omitempty"` + // either `true` to allow fast-forward-only merging pull requests, or `false` to prevent fast-forward-only merging. + AllowFastForwardOnly *bool `json:"allow_fast_forward_only_merge,omitempty"` // either `true` to allow mark pr as merged manually, or `false` to prevent it. AllowManualMerge *bool `json:"allow_manual_merge,omitempty"` // either `true` to enable AutodetectManualMerge, or `false` to prevent it. Note: In some special cases, misjudgments can occur. @@ -203,7 +206,7 @@ type EditRepoOption struct { AllowRebaseUpdate *bool `json:"allow_rebase_update,omitempty"` // set to `true` to delete pr branch after merge by default DefaultDeleteBranchAfterMerge *bool `json:"default_delete_branch_after_merge,omitempty"` - // set to a merge style to be used by this repository: "merge", "rebase", "rebase-merge", or "squash". + // set to a merge style to be used by this repository: "merge", "rebase", "rebase-merge", "squash", or "fast-forward-only". DefaultMergeStyle *string `json:"default_merge_style,omitempty"` // set to `true` to allow edits from maintainers by default DefaultAllowMaintainerEdit *bool `json:"default_allow_maintainer_edit,omitempty"` |