Skip to content

Commit

Permalink
Add --append-git-tag
Browse files Browse the repository at this point in the history
Fixes cookpete#190 if you use --append-git-tag "--merged" with Git 2.7+
  • Loading branch information
cookpete committed May 23, 2021
1 parent 2f7c3ab commit 20bb145
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Options:
--hide-credit # hide auto-changelog credit
--handlebars-setup [file] # handlebars setup file
--append-git-log [string] # string to append to git log command
--append-git-tag [string] # string to append to git tag command
--prepend # prepend changelog to output file
--stdout # output changelog to stdout
-V, --version # output the version number
Expand Down
2 changes: 2 additions & 0 deletions src/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const DEFAULT_OPTIONS = {
tagPrefix: '',
sortCommits: 'relevance',
appendGitLog: '',
appendGitTag: '',
config: '.auto-changelog'
}

Expand Down Expand Up @@ -52,6 +53,7 @@ const getOptions = async argv => {
.option('--hide-credit', 'hide auto-changelog credit')
.option('--handlebars-setup <file>', 'handlebars setup file')
.option('--append-git-log <string>', 'string to append to git log command')
.option('--append-git-tag <string>', 'string to append to git tag command')
.option('--prepend', 'prepend changelog to output file')
.option('--stdout', 'output changelog to stdout')
.version(version)
Expand Down
2 changes: 1 addition & 1 deletion src/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const MATCH_V = /^v\d/

const fetchTags = async (options, remote) => {
const format = `%(refname:short)${DIVIDER}%(creatordate:short)`
const tags = (await cmd(`git tag -l --sort=-creatordate --format=${format}`))
const tags = (await cmd(`git tag -l --sort=-creatordate --format=${format} ${options.appendGitTag}`))
.trim()
.split('\n')
.map(parseTag(options))
Expand Down

0 comments on commit 20bb145

Please sign in to comment.