Skip to content

Commit

Permalink
Add --append-git-log option
Browse files Browse the repository at this point in the history
Closes #118
Fixes #117
  • Loading branch information
cookpete committed Jul 7, 2019
1 parent 01739fe commit 68c20a8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Options:
--include-branch [branch] # one or more branches to include commits from, comma separated
--release-summary # display tagged commit message body as release summary
--handlebars-setup [file] # handlebars setup file
--append-git-log [string] # string to append to git log command
--stdout # output changelog to stdout
-V, --version # output the version number
-h, --help # output usage information
Expand Down
2 changes: 1 addition & 1 deletion src/commits.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const MERGE_PATTERNS = [
export async function fetchCommits (remote, options, branch = null, onProgress) {
const command = branch ? `git log ${branch}` : 'git log'
const format = await getLogFormat()
const log = await cmd(`${command} --shortstat --pretty=format:${format}`, onProgress)
const log = await cmd(`${command} --shortstat --pretty=format:${format} ${options.appendGitLog}`, onProgress)
return parseCommits(log, remote, options)
}

Expand Down
4 changes: 3 additions & 1 deletion src/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const DEFAULT_OPTIONS = {
commitLimit: 3,
backfillLimit: 3,
tagPrefix: '',
sortCommits: 'relevance'
sortCommits: 'relevance',
appendGitLog: ''
}

const PACKAGE_FILE = 'package.json'
Expand Down Expand Up @@ -44,6 +45,7 @@ async function getOptions (argv) {
.option('--include-branch <branch>', 'one or more branches to include commits from, comma separated', str => str.split(','))
.option('--release-summary', 'use tagged commit message body as release summary')
.option('--handlebars-setup <file>', 'handlebars setup file')
.option('--append-git-log <string>', 'string to append to git log command')
.option('--stdout', 'output changelog to stdout')
.version(version)
.parse(argv)
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function formatBytes (bytes) {

// Simple util for calling a child process
export function cmd (string, onProgress) {
const [ cmd, ...args ] = string.split(' ')
const [ cmd, ...args ] = string.trim().split(' ')
return new Promise((resolve, reject) => {
const child = spawn(cmd, args)
let data = ''
Expand Down

0 comments on commit 68c20a8

Please sign in to comment.