diff --git a/commands/issue.go b/commands/issue.go index 1742017b..76ae0709 100644 --- a/commands/issue.go +++ b/commands/issue.go @@ -362,6 +362,11 @@ func createIssue(cmd *Command, args *Args) { Title: "issue", } + messageBuilder.AddCommentedSection(fmt.Sprintf(`Creating an issue for %s + +Write a message for this issue. The first block of +text is the title and the rest is the description.`, project)) + if cmd.FlagPassed("message") { messageBuilder.Message = flagIssueMessage messageBuilder.Edit = flagIssueEdit @@ -371,23 +376,16 @@ func createIssue(cmd *Command, args *Args) { messageBuilder.Edit = flagIssueEdit } else { messageBuilder.Edit = true - message := "" - helpMessage := fmt.Sprintf(`Creating an issue for %s - -Write a message for this issue. The first block of -text is the title and the rest is the description.`, project) workdir, _ := git.WorkdirName() if workdir != "" { template, err := github.ReadTemplate(github.IssueTemplate, workdir) utils.Check(err) if template != "" { - message = template + messageBuilder.Message = template } } - messageBuilder.Message = message - messageBuilder.AddCommentedSection(helpMessage) } title, body, err := messageBuilder.Extract() diff --git a/commands/pull_request.go b/commands/pull_request.go index 151aa84a..d9948dfe 100644 --- a/commands/pull_request.go +++ b/commands/pull_request.go @@ -225,6 +225,11 @@ func pullRequest(cmd *Command, args *Args) { utils.Check(fmt.Errorf("Can't find remote for %s", head)) } + messageBuilder.AddCommentedSection(fmt.Sprintf(`Requesting a pull to %s from %s + +Write a message for this pull request. The first block +of text is the title and the rest is the description.`, fullBase, fullHead)) + if cmd.FlagPassed("message") { messageBuilder.Message = flagPullRequestMessage messageBuilder.Edit = flagPullRequestEdit @@ -252,6 +257,10 @@ func pullRequest(cmd *Command, args *Args) { utils.Check(err) } + if commitLogs != "" { + messageBuilder.AddCommentedSection("\nChanges:\n\n" + strings.TrimSpace(commitLogs)) + } + workdir, _ := git.WorkdirName() if workdir != "" { template, _ := github.ReadTemplate(github.PullRequestTemplate, workdir) @@ -260,16 +269,7 @@ func pullRequest(cmd *Command, args *Args) { } } - helpMessage := fmt.Sprintf(`Requesting a pull to %s from %s - -Write a message for this pull request. The first block -of text is the title and the rest is the description.`, fullBase, fullHead) - if commitLogs != "" { - helpMessage = helpMessage + "\n\nChanges:\n\n" + strings.TrimSpace(commitLogs) - } - messageBuilder.Message = message - messageBuilder.AddCommentedSection(helpMessage) } title, body, err := messageBuilder.Extract() diff --git a/commands/release.go b/commands/release.go index cf19f33b..7ee71c28 100644 --- a/commands/release.go +++ b/commands/release.go @@ -301,6 +301,11 @@ func createRelease(cmd *Command, args *Args) { Title: "release", } + messageBuilder.AddCommentedSection(fmt.Sprintf(`Creating release %s for %s + +Write a message for this release. The first block of +text is the title and the rest is the description.`, tagName, project)) + if cmd.FlagPassed("message") { messageBuilder.Message = flagReleaseMessage messageBuilder.Edit = flagReleaseEdit @@ -310,12 +315,6 @@ func createRelease(cmd *Command, args *Args) { messageBuilder.Edit = flagReleaseEdit } else { messageBuilder.Edit = true - helpMessage := fmt.Sprintf(`Creating release %s for %s - -Write a message for this release. The first block of -text is the title and the rest is the description.`, tagName, project.String()) - - messageBuilder.AddCommentedSection(helpMessage) } title, body, err := messageBuilder.Extract() @@ -388,6 +387,11 @@ func editRelease(cmd *Command, args *Args) { Title: "release", } + messageBuilder.AddCommentedSection(fmt.Sprintf(`Editing release %s for %s + +Write a message for this release. The first block of +text is the title and the rest is the description.`, tagName, project)) + if cmd.FlagPassed("message") { messageBuilder.Message = flagReleaseMessage messageBuilder.Edit = flagReleaseEdit @@ -398,12 +402,6 @@ func editRelease(cmd *Command, args *Args) { } else { messageBuilder.Edit = true messageBuilder.Message = fmt.Sprintf("%s\n\n%s", release.Name, release.Body) - helpMessage := fmt.Sprintf(`Editing release %s for %s - -Write a message for this release. The first block of -text is the title and the rest is the description.`, tagName, project.String()) - - messageBuilder.AddCommentedSection(helpMessage) } title, body, err := messageBuilder.Extract()