Ability to create branch & mr for issue
Is your feature request related to a problem? Please describe.
I would find it useful to be able to create branches and MR for an issue from command line, similar to the way Gitlab's "Create Merge Request" works. This is something that could dramatically speed up workflows that create branches for each issue without needing to manually create a MR, add a title it and add a /close #issue-num
for each issue.
Describe the solution you'd like User creates an issue:
$ glab issue create -t "My issue"
#1 My Issue about 1 minute ago
User creates branch and MR that closes the issue in one command (functionally equivalent to clicking the "Create Merge Request" in the browser"
$ glab mr for 1
branch 1-my-issue created
created merge request !1 to address this issue
The "Create Merge Request" button just uses the create_merge_request
endpoint, it creates a post request to: https://gitlab.com/group/project/-/issues/1/create_merge_request?branch_name=1-my-issue&ref=master .
Using the go-gitlab module, you could copy the mr_create.go
command to mr_for.go
and add automatically generate the title and add "/close #issue-num" to the description.
Describe alternatives you've considered Opening each issue in the borwser and clicking the "Create Merge Request" button
OR
From the cli, create mr -t 'My Issue (#issue-num)'
and adding
Closes #issue-num
in the description
Additional context