Skip to content

Commit

Permalink
Include the JIRA Description in the commit message after a blank line.
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Kunicki committed Jan 14, 2020
1 parent 27bcfa4 commit 4ef4ded
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/brew.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,13 @@ func checkout(repo *git.Repository, issue *jira.Issue) error {
}

if newBranch {
commitMessage := fmt.Sprintf("%s. %s", issue.Key, issue.Fields.Summary)
// If an issue description was provided, that isn't simply a repeat of the summary, we'll automatically include
// it in the commit message after the break.
extendedDescription := ""
if issue.Fields.Summary != issue.Fields.Description {
extendedDescription = fmt.Sprintf("\n\n%s", issue.Fields.Description)
}
commitMessage := fmt.Sprintf("%s. %s%s", issue.Key, issue.Fields.Summary, extendedDescription)
usr, err := user.Current()
if err != nil {
return err
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ require (
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529 // indirect
gopkg.in/src-d/go-git.v4 v4.12.0
)

go 1.13

0 comments on commit 4ef4ded

Please sign in to comment.