Add push option to select target project for MR
requested to merge webpros-col/gitlab:feature.allow-target-project-selection-with-mr-push-option into master
What does this MR do and why?
This merge request addresses #342985 (closed) by adding the merge_request.target_project
push option so users can select the target project when creating a merge request, all with the vanilla Git client.
Screenshots or screen recordings
None provided
How to set up and validate locally
- Create project; we'll call this the base project.
- Fork base project into what we'll call the intermediate project.
- Fork intermediate project into what we'll call the leaf project.
- Clone the leaf project (as "origin") onto a system with
git clone
. - Checkout a new branch and commit changes to it.
- Run
git push -f -o merge_request.create origin HEAD
; notice how the created MR is to the intermediate project. - Run
git commit --amend --no-edit
so the next push will actually occur (make sure at least 1 second has occurred since last commit). - Run
git push -f -o merge_request.create -o merge_request.target_project=<gitlab-path/to/base-project> origin HEAD
; notice how the MR is to the base project. - Run
git commit --amend --no-edit
. - Run
git push -f -o merge_request.create -o merge_request.target_project=DOES-NOT-EXIST origin HEAD
; notice error. - Run
git commit --amend --no-edit
. - Run
git push -f -o merge_request.create -o merge_request.target_project=<unrelated-project> origin HEAD
; notice error.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.