From 0b5eaef34408d938a4d9c2c3f8134edf96f32d2c Mon Sep 17 00:00:00 2001 From: Thales Menezes Date: Sun, 6 Mar 2022 15:52:19 -0300 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20path=20option=20to=20getCommits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/git-raw-commits#gitoptspath --- packages/gitmoji-changelog-core/src/fromGitFile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/gitmoji-changelog-core/src/fromGitFile.js b/packages/gitmoji-changelog-core/src/fromGitFile.js index fc32e3a..65a8500 100644 --- a/packages/gitmoji-changelog-core/src/fromGitFile.js +++ b/packages/gitmoji-changelog-core/src/fromGitFile.js @@ -18,12 +18,13 @@ function parseCommit(commit) { } } -function getCommits(from, to) { +function getCommits(from, to, path = '.') { return new Promise(resolve => { gitRawCommits({ format: COMMIT_FORMAT, from, to, + path, }) .pipe( through.obj((data, enc, next) => { From 66b0da7746e10ab04cecc6e510e9128570f6ef94 Mon Sep 17 00:00:00 2001 From: Thales Menezes Date: Sun, 6 Mar 2022 15:53:26 -0300 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=A8=20path=20option=20in=20generateCh?= =?UTF-8?q?angelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/gitmoji-changelog-core/src/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/gitmoji-changelog-core/src/index.js b/packages/gitmoji-changelog-core/src/index.js index 0800797..87d25b3 100644 --- a/packages/gitmoji-changelog-core/src/index.js +++ b/packages/gitmoji-changelog-core/src/index.js @@ -57,9 +57,10 @@ async function generateVersion(options) { version, groupSimilarCommits, client, + path, } = options - const rawCommits = await client.getCommits(from, to) + const rawCommits = await client.getCommits(from, to, path) let commits = filterCommits(rawCommits.map(parseCommit)) @@ -108,6 +109,7 @@ async function generateVersions({ release, groupSimilarCommits, client, + path, }) { let nextTag = HEAD const targetVersion = hasNext ? 'next' : sanitizeVersion(release) @@ -117,7 +119,7 @@ async function generateVersions({ const to = nextTag nextTag = tag return generateVersion({ - from, to, version, groupSimilarCommits, client, + from, to, version, groupSimilarCommits, client, path, }) })) .then(versions => versions.sort(sortVersions)) @@ -126,7 +128,7 @@ async function generateVersions({ } async function generateChangelog(from, to, { - groupSimilarCommits, client = fromGitFileClient, + groupSimilarCommits, client = fromGitFileClient, path, } = {}) { const gitTags = await client.getTags() let tagsToProcess = [...gitTags] @@ -156,6 +158,7 @@ async function generateChangelog(from, to, { release: to, groupSimilarCommits, client, + path, }) if (from !== TAIL && changes.length === 1 && isEmpty(changes[0].groups)) {