Skip to content

Commit

Permalink
mr discussion: add some examples for optional MR ID / branch
Browse files Browse the repository at this point in the history
The first parameter is the remote, that can be left out because it
defaults to the default remote or origin (see guessDefaultRemote()).
Add an example that uses the default remote; that should be good
enough in many scenarios.

All examples assume that the merge request's source branch is
checked out (because they don't pass an explicit MR id parameter).
Add examples that specify a different MR, either via MR id or by
branch name.

Signed-off-by: Johannes Altmanninger <aclopte@gmail.com>
  • Loading branch information
krobelus committed Oct 26, 2021
1 parent 4b03b4f commit 1153920
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/mr_discussion.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ var mrCreateDiscussionCmd = &cobra.Command{
Short: "Start a discussion on an MR on GitLab",
Aliases: []string{"block", "thread"},
Example: heredoc.Doc(`
lab mr discussion
lab mr discussion origin
lab mr discussion my_remote -m "discussion comment"
lab mr discussion upstream -F test_file.txt
lab mr discussion --commit abcdef123456`),
lab mr discussion --commit abcdef123456
lab mr discussion my-topic-branch
lab mr discussion origin 123
lab mr discussion origin my-topic-branch
`),
PersistentPreRun: labPersistentPreRun,
Run: func(cmd *cobra.Command, args []string) {
rn, mrNum, err := parseArgsWithGitBranchMR(args)
Expand Down

0 comments on commit 1153920

Please sign in to comment.