Skip to content

Commit 4c59f30

Browse files
committed
mr show: Fix --patch and --comments option output
Users have been setting "comments = true" for the mr show command. This causes weird output with the --patch output in which the git log is output, then the comments from the MR is output. Make a note that --patch and --comments do not work together and stop the output after the git log is output. Signed-off-by: Prarit Bhargava <prarit@redhat.com>
1 parent 4871910 commit 4c59f30

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmd/mr_show.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ var mrShowCmd = &cobra.Command{
6262
log.Fatal(err)
6363
}
6464
git.Show(remote+"/"+mr.TargetBranch, mr.SHA, mrShowPatchReverse)
65+
return
6566
} else {
6667
pager := newPager(cmd.Flags())
6768
defer pager.Close()
@@ -239,9 +240,9 @@ func printMR(mr *gitlab.MergeRequest, project string, renderMarkdown bool) {
239240

240241
func init() {
241242
mrShowCmd.Flags().BoolP("no-markdown", "M", false, "don't use markdown renderer to print the issue description")
242-
mrShowCmd.Flags().BoolP("comments", "c", false, "show comments for the merge request")
243+
mrShowCmd.Flags().BoolP("comments", "c", false, "show comments for the merge request (does not work with --patch)")
243244
mrShowCmd.Flags().StringP("since", "s", "", "show comments since specified date (format: 2020-08-21 14:57:46.808 +0000 UTC)")
244-
mrShowCmd.Flags().BoolVarP(&mrShowPatch, "patch", "p", false, "show MR patches")
245+
mrShowCmd.Flags().BoolVarP(&mrShowPatch, "patch", "p", false, "show MR patches (does not work with --comments)")
245246
mrShowCmd.Flags().BoolVarP(&mrShowPatchReverse, "reverse", "", false, "reverse order when showing MR patches (chronological instead of anti-chronological)")
246247
mrShowCmd.Flags().BoolVarP(&mrShowNoColorDiff, "no-color-diff", "", false, "do not show color diffs in comments")
247248
mrCmd.AddCommand(mrShowCmd)

0 commit comments

Comments
 (0)