From 756d9a07d0fea897b945cb200d74ab940402d403 Mon Sep 17 00:00:00 2001 From: Peter Admilson Ramaldes Date: Mon, 25 Sep 2023 07:26:33 -0300 Subject: [PATCH 1/3] docs: update the flag `--fill` docs The `--title` and/or `--body` could be overwritten when use `--fill` togheter, so, this change makes this behavior more evident --- pkg/cmd/pr/create/create.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/pr/create/create.go b/pkg/cmd/pr/create/create.go index 7321d4f38..ad1a954cb 100644 --- a/pkg/cmd/pr/create/create.go +++ b/pkg/cmd/pr/create/create.go @@ -193,8 +193,8 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co fl.StringVarP(&opts.BaseBranch, "base", "B", "", "The `branch` into which you want your code merged") fl.StringVarP(&opts.HeadBranch, "head", "H", "", "The `branch` that contains commits for your pull request (default: current branch)") fl.BoolVarP(&opts.WebMode, "web", "w", false, "Open the web browser to create a pull request") - fl.BoolVarP(&opts.Autofill, "fill", "f", false, "Do not prompt for title/body and just use commit info") - fl.BoolVar(&opts.FillFirst, "fill-first", false, "Do not prompt for title/body and just use first commit info") + fl.BoolVarP(&opts.Autofill, "fill", "f", false, "Do not prompt for title/body and just use commit info (could be overwritten by --title and/or --body)") + fl.BoolVar(&opts.FillFirst, "fill-first", false, "Do not prompt for title/body and just use first commit info (could be overwritten by --title and/or --body)") fl.StringSliceVarP(&opts.Reviewers, "reviewer", "r", nil, "Request reviews from people or teams by their `handle`") fl.StringSliceVarP(&opts.Assignees, "assignee", "a", nil, "Assign people by their `login`. Use \"@me\" to self-assign.") fl.StringSliceVarP(&opts.Labels, "label", "l", nil, "Add labels by `name`") From d4668c599ed02f74ad5fc207d51c8dd253ce3a6c Mon Sep 17 00:00:00 2001 From: Peter Admilson Ramaldes Date: Thu, 28 Sep 2023 06:00:54 -0300 Subject: [PATCH 2/3] docs: update the details of fill and fill-first --- pkg/cmd/pr/create/create.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/pr/create/create.go b/pkg/cmd/pr/create/create.go index ad1a954cb..d70c2f740 100644 --- a/pkg/cmd/pr/create/create.go +++ b/pkg/cmd/pr/create/create.go @@ -105,6 +105,14 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co to push the branch and offer an option to fork the base repository. Use %[1]s--head%[1]s to explicitly skip any forking or pushing behavior. + A prompt will also ask for the title and the body of the pull request. + Use %[1]s--title%[1]s and %[1]s--body%[1]s to skip this, or use + %[1]s--fill%[1]s to autofill these values from git commits. It's + important to notice that if the %[1]s--title%[1]s and/or %[1]s--body%[1]s + are also provided alongside %[1]s--fill%[1]s, the values specified by + %[1]s--title%[1]s and/or %[1]s--body%[1]s will take precedence and + overwrite any autofilled content. + A prompt will also ask for the title and the body of the pull request. Use %[1]s--title%[1]s and %[1]s--body%[1]s to skip this, or use %[1]s--fill%[1]s to autofill these values from git commits. @@ -193,8 +201,8 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co fl.StringVarP(&opts.BaseBranch, "base", "B", "", "The `branch` into which you want your code merged") fl.StringVarP(&opts.HeadBranch, "head", "H", "", "The `branch` that contains commits for your pull request (default: current branch)") fl.BoolVarP(&opts.WebMode, "web", "w", false, "Open the web browser to create a pull request") - fl.BoolVarP(&opts.Autofill, "fill", "f", false, "Do not prompt for title/body and just use commit info (could be overwritten by --title and/or --body)") - fl.BoolVar(&opts.FillFirst, "fill-first", false, "Do not prompt for title/body and just use first commit info (could be overwritten by --title and/or --body)") + fl.BoolVarP(&opts.Autofill, "fill", "f", false, "Use commit info for title and body") + fl.BoolVar(&opts.FillFirst, "fill-first", false, "Use first commit info for title and body") fl.StringSliceVarP(&opts.Reviewers, "reviewer", "r", nil, "Request reviews from people or teams by their `handle`") fl.StringSliceVarP(&opts.Assignees, "assignee", "a", nil, "Assign people by their `login`. Use \"@me\" to self-assign.") fl.StringSliceVarP(&opts.Labels, "label", "l", nil, "Add labels by `name`") From c10371605c0b70e07221a90e159784676e186f81 Mon Sep 17 00:00:00 2001 From: "Peter A. Ramaldes" Date: Mon, 2 Oct 2023 14:46:02 -0300 Subject: [PATCH 3/3] Update pkg/cmd/pr/create/create.go Co-authored-by: Andy Feller --- pkg/cmd/pr/create/create.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/cmd/pr/create/create.go b/pkg/cmd/pr/create/create.go index d70c2f740..3e60a7240 100644 --- a/pkg/cmd/pr/create/create.go +++ b/pkg/cmd/pr/create/create.go @@ -105,13 +105,11 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co to push the branch and offer an option to fork the base repository. Use %[1]s--head%[1]s to explicitly skip any forking or pushing behavior. - A prompt will also ask for the title and the body of the pull request. - Use %[1]s--title%[1]s and %[1]s--body%[1]s to skip this, or use - %[1]s--fill%[1]s to autofill these values from git commits. It's - important to notice that if the %[1]s--title%[1]s and/or %[1]s--body%[1]s - are also provided alongside %[1]s--fill%[1]s, the values specified by - %[1]s--title%[1]s and/or %[1]s--body%[1]s will take precedence and - overwrite any autofilled content. + A prompt will also ask for the title and the body of the pull request. Use %[0]s--title%[1]s and + %[1]s--body%[1]s to skip this, or use %[1]s--fill%[1]s to autofill these values from git commits. + It's important to notice that if the %[1]s--title%[1]s and/or %[1]s--body%[1]s are also provided + alongside %[1]s--fill%[1]s, the values specified by %[1]s--title%[1]s and/or %[1]s--body%[1]s will + take precedence and overwrite any autofilled content. A prompt will also ask for the title and the body of the pull request. Use %[1]s--title%[1]s and %[1]s--body%[1]s to skip this, or use %[1]s--fill%[1]s to autofill these values from git commits.