aboutsummaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorViktor Kuzmin <kvaster@gmail.com>2024-01-17 03:44:56 +0300
committerGitHub <noreply@github.com>2024-01-17 01:44:56 +0100
commit49eb16867728913d1eb2ced96e0b0b0a358f6ebe (patch)
tree7c0d5ca1e3fc35890e38085e7ca0eb1cdeddec0a /modules/setting
parent9c869b10b5a15adc04c0b93a13d6c5fb2add1304 (diff)
downloadgitea-49eb16867728913d1eb2ced96e0b0b0a358f6ebe.tar.gz
gitea-49eb16867728913d1eb2ced96e0b0b0a358f6ebe.zip
Retarget depending pulls when the parent branch is deleted (#28686)
Sometimes you need to work on a feature which depends on another (unmerged) feature. In this case, you may create a PR based on that feature instead of the main branch. Currently, such PRs will be closed without the possibility to reopen in case the parent feature is merged and its branch is deleted. Automatic target branch change make life a lot easier in such cases. Github and Bitbucket behave in such way. Example: $PR_1$: main <- feature1 $PR_2$: feature1 <- feature2 Currently, merging $PR_1$ and deleting its branch leads to $PR_2$ being closed without the possibility to reopen. This is both annoying and loses the review history when you open a new PR. With this change, $PR_2$ will change its target branch to main ($PR_2$: main <- feature2) after $PR_1$ has been merged and its branch has been deleted. This behavior is enabled by default but can be disabled. For security reasons, this target branch change will not be executed when merging PRs targeting another repo. Fixes #27062 Fixes #18408 --------- Co-authored-by: Denys Konovalov <kontakt@denyskon.de> Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/repository.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/setting/repository.go b/modules/setting/repository.go
index 9697a851d3..a6f0ed8833 100644
--- a/modules/setting/repository.go
+++ b/modules/setting/repository.go
@@ -85,6 +85,7 @@ var (
PopulateSquashCommentWithCommitMessages bool
AddCoCommitterTrailers bool
TestConflictingPatchesWithGitApply bool
+ RetargetChildrenOnMerge bool
} `ini:"repository.pull-request"`
// Issue Setting
@@ -209,6 +210,7 @@ var (
PopulateSquashCommentWithCommitMessages bool
AddCoCommitterTrailers bool
TestConflictingPatchesWithGitApply bool
+ RetargetChildrenOnMerge bool
}{
WorkInProgressPrefixes: []string{"WIP:", "[WIP]"},
// Same as GitHub. See
@@ -223,6 +225,7 @@ var (
DefaultMergeMessageOfficialApproversOnly: true,
PopulateSquashCommentWithCommitMessages: false,
AddCoCommitterTrailers: true,
+ RetargetChildrenOnMerge: true,
},
// Issue settings