mirror of
https://github.com/git-chglog/git-chglog.git
synced 2026-01-23 02:15:12 +00:00
commit
ec0e3c56af
5 changed files with 36 additions and 15 deletions
|
|
@ -8,7 +8,7 @@
|
|||
{{end}}{{if .RevertCommits}}
|
||||
### Reverts
|
||||
{{range .RevertCommits}}
|
||||
* {{.Header}}{{end}}
|
||||
* {{.Revert.Header}}{{end}}
|
||||
{{end}}{{if .MergeCommits}}
|
||||
### Pull Requests
|
||||
{{range .MergeCommits}}
|
||||
|
|
|
|||
14
CHANGELOG.md
14
CHANGELOG.md
|
|
@ -1,5 +1,19 @@
|
|||
# CHANGELOG
|
||||
|
||||
|
||||
<a name="0.0.2"></a>
|
||||
## [0.0.2](https://github.com/git-chglog/git-chglog/compare/0.0.1...0.0.2) (2018-02-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix `Revert` of template created by Initializer
|
||||
|
||||
### Features
|
||||
|
||||
* Add Git Basic to commit message format
|
||||
* Add preview to the commit message format of `--init` option
|
||||
|
||||
|
||||
<a name="0.0.1"></a>
|
||||
## 0.0.1 (2018-02-18)
|
||||
|
||||
|
|
|
|||
|
|
@ -24,12 +24,14 @@ var (
|
|||
styleNone,
|
||||
}
|
||||
|
||||
fmtTypeScopeSubject = "<type>(<scope>): <subject>"
|
||||
fmtTypeSubject = "<type>: <subject>"
|
||||
fmtSubject = "<subject>"
|
||||
fmtTypeScopeSubject = "<type>(<scope>): <subject> -- feat(core) Add new feature"
|
||||
fmtTypeSubject = "<type>: <subject> -- feat: Add new feature"
|
||||
fmtGitBasic = "<<type> subject> -- Add new feature"
|
||||
fmtSubject = "<subject> -- Add new feature (Not detect `type` field)"
|
||||
commitMessageFormats = []string{
|
||||
fmtTypeScopeSubject,
|
||||
fmtTypeSubject,
|
||||
fmtGitBasic,
|
||||
fmtSubject,
|
||||
}
|
||||
|
||||
|
|
@ -259,6 +261,11 @@ func (init *Initializer) createConfigYamlContent(answer *Answer) string {
|
|||
headerPatternMaps = `
|
||||
- Type
|
||||
- Subject`
|
||||
case fmtGitBasic:
|
||||
headerPattern = `^((\\w+)\\s.*)$`
|
||||
headerPatternMaps = `
|
||||
- Subject
|
||||
- Type`
|
||||
case fmtSubject:
|
||||
headerPattern = `^(.*)$`
|
||||
headerPatternMaps = `
|
||||
|
|
@ -309,17 +316,17 @@ func (init *Initializer) createTemplate(answer *Answer) string {
|
|||
// commits
|
||||
tpl += init.commits(answer.Style, answer.Template, answer.CommitMessageFormat)
|
||||
|
||||
// merges
|
||||
// revert
|
||||
if answer.IncludeReverts {
|
||||
tpl += `{{if .RevertCommits}}
|
||||
### Reverts
|
||||
{{range .RevertCommits}}
|
||||
* {{.Header}}{{end}}
|
||||
* {{.Revert.Header}}{{end}}
|
||||
{{end}}`
|
||||
}
|
||||
|
||||
// reverts
|
||||
if answer.IncludeReverts {
|
||||
// merge
|
||||
if answer.IncludeMerges {
|
||||
tpl += fmt.Sprintf(`{{if .MergeCommits}}
|
||||
### %s
|
||||
{{range .MergeCommits}}
|
||||
|
|
@ -380,7 +387,12 @@ func (*Initializer) commits(style, template, format string) string {
|
|||
)
|
||||
|
||||
switch format {
|
||||
case fmtTypeScopeSubject, fmtTypeSubject:
|
||||
case fmtSubject:
|
||||
body = `{{range .Commits}}
|
||||
* {{.Header}}{{end}}
|
||||
`
|
||||
|
||||
default:
|
||||
if format == fmtTypeScopeSubject {
|
||||
header = "{{if ne .Scope \"\"}}**{{.Scope}}:** {{end}}{{.Subject}}"
|
||||
} else {
|
||||
|
|
@ -391,11 +403,6 @@ func (*Initializer) commits(style, template, format string) string {
|
|||
{{range .Commits}}
|
||||
* %s{{end}}
|
||||
`, header)
|
||||
|
||||
case fmtSubject:
|
||||
body = `{{range .Commits}}
|
||||
* {{.Header}}{{end}}
|
||||
`
|
||||
}
|
||||
|
||||
return fmt.Sprintf(`{{range .CommitGroups}}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
|
||||
// Version of git-chglog cli client
|
||||
const Version = "0.0.1"
|
||||
const Version = "0.0.2"
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 532 KiB After Width: | Height: | Size: 629 KiB |
Loading…
Add table
Add a link
Reference in a new issue