mirror of
1
Fork 0
forgejo/services/pull
Viktor Kuzmin 49eb168677
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>
2024-01-17 01:44:56 +01:00
..
check.go Abstract hash function usage (#28138) 2023-12-13 21:02:00 +00:00
check_test.go Replace assert.Fail with assert.FailNow (#27578) 2023-10-11 11:02:24 +00:00
comment.go Delete `issue_service.CreateComment` (#26298) 2023-08-04 13:34:34 +00:00
commit_status.go Fix pull request check list is limited (#26179) 2023-07-31 02:21:09 +00:00
edits.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
lfs.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
merge.go Abstract hash function usage (#28138) 2023-12-13 21:02:00 +00:00
merge_merge.go Refactor and tidy-up the merge/update branch code (#22568) 2023-03-07 15:07:35 -05:00
merge_prepare.go Refactor merge/update git command calls (#23366) 2023-03-09 09:48:52 -06:00
merge_rebase.go Merge message template support for rebase without merge commit (#22669) 2023-05-22 09:01:46 +08:00
merge_squash.go Improve squash merge commit author and co-author with private emails (#22977) 2023-03-09 22:17:04 -05:00
merge_test.go Support template for merge message description (#22248) 2022-12-29 14:40:20 +02:00
patch.go Improve ObjectFormat interface (#28496) 2023-12-19 07:20:47 +00:00
patch_unmerged.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
pull.go Retarget depending pulls when the parent branch is deleted (#28686) 2024-01-17 01:44:56 +01:00
pull_test.go Support template for merge message description (#22248) 2022-12-29 14:40:20 +02:00
review.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
temp_repo.go Adjust object format interface (#28469) 2023-12-17 11:56:08 +00:00
update.go Sync branches into databases (#22743) 2023-06-29 10:03:20 +00:00
update_rebase.go Refactor and tidy-up the merge/update branch code (#22568) 2023-03-07 15:07:35 -05:00