From 20bb145e2dee40cfc55ccbe5850b131deedcca5c Mon Sep 17 00:00:00 2001 From: Pete Cook Date: Sun, 23 May 2021 22:51:04 +0100 Subject: [PATCH] Add --append-git-tag Fixes https://github.com/cookpete/auto-changelog/issues/190 if you use --append-git-tag "--merged" with Git 2.7+ --- README.md | 1 + src/run.js | 2 ++ src/tags.js | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 799b411c..bd72db6f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/run.js b/src/run.js index 9406d2a3..468c1fbb 100644 --- a/src/run.js +++ b/src/run.js @@ -15,6 +15,7 @@ const DEFAULT_OPTIONS = { tagPrefix: '', sortCommits: 'relevance', appendGitLog: '', + appendGitTag: '', config: '.auto-changelog' } @@ -52,6 +53,7 @@ const getOptions = async argv => { .option('--hide-credit', 'hide auto-changelog credit') .option('--handlebars-setup ', 'handlebars setup file') .option('--append-git-log ', 'string to append to git log command') + .option('--append-git-tag ', 'string to append to git tag command') .option('--prepend', 'prepend changelog to output file') .option('--stdout', 'output changelog to stdout') .version(version) diff --git a/src/tags.js b/src/tags.js index fdbc7658..48d2b264 100644 --- a/src/tags.js +++ b/src/tags.js @@ -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))