From d6acd1bbfbacaf21fe9944e090dcaf5fc8427529 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 20 Nov 2026 15:02:38 +0100 Subject: [PATCH 1/6] feat: add `--extra-git-log-flags` CLI flag --- branch-diff.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/branch-diff.js b/branch-diff.js index 6c206f5..1334041 100755 --- a/branch-diff.js +++ b/branch-diff.js @@ -20,7 +20,7 @@ const pkgData = fs.existsSync(pkgFile) ? require(pkgFile) : {} const pkgId = pkgtoId(pkgData) const refcmd = 'git rev-list --max-count=1 {{ref}}' const commitdatecmd = '$(git show -s --format=%cd `{{refcmd}}`)' -const gitcmd = 'git log {{startCommit}}..{{branch}} --until="{{untilcmd}}"' +const gitcmd = 'git log {{startCommit}}..{{branch}} --until="{{untilcmd}}"{{gitLogFlags}}' const ghId = { user: pkgId.user || 'nodejs', repo: pkgId.name || 'node' @@ -41,7 +41,7 @@ export async function branchDiff (branch1, branch2, options) { const repoPath = options.repoPath || process.cwd() const commit = await findMergeBase(repoPath, branch1, branch2) const branchCommits = await Promise.all([branch1, branch2].map(async (branch) => { - return collect(repoPath, branch, commit, branch === branch2 && options.endRef) + return collect(repoPath, branch, commit, branch === branch2 && options.endRef, options.gitLogFlags) })) return await diffCollected(options, branchCommits) } @@ -102,10 +102,10 @@ async function diffCollected (options, branchCommits) { return list } -async function collect (repoPath, branch, startCommit, endRef) { +async function collect (repoPath, branch, startCommit, endRef, gitLogFlags = '') { const endrefcmd = endRef && replace(refcmd, { ref: endRef }) const untilcmd = endRef ? replace(commitdatecmd, { refcmd: endrefcmd }) : '' - const _gitcmd = replace(gitcmd, { branch, startCommit, untilcmd }) + const _gitcmd = replace(gitcmd, { branch, startCommit, untilcmd, gitLogFlags }) const commitList = [] await pipeline( @@ -127,6 +127,7 @@ async function main () { 'commit-url': { type: 'string' }, 'end-ref': { type: 'string' }, 'exclude-label': { type: 'string', multiple: true }, + 'extra-git-log-flags': { type: 'string' }, 'filter-release': { type: 'boolean' }, 'find-matching-prs': { type: 'boolean' }, format: { type: 'string' }, @@ -162,6 +163,7 @@ async function main () { } const options = { + gitLogFlags: argv['extra-git-log-flags'], group: argv.group, excludeLabels, requireLabels, From 9ca9f8906c809fb5c5c360c0784c7e150073e93c Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 28 Nov 2026 11:42:50 +0100 Subject: [PATCH 2/6] switch to `--paths` --- README.md | 1 + branch-diff.js | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 75ede69..0974914 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ But the comparison isn't quite as strict, generally leading to a shorter list of * `--group` or `-g`: Group commits by prefix, this uses the part of the commit summary that is usually used in Node.js core to indicate subsystem for example. Groups are made up of numbers, letters, `,` and `-`, followed by a `:`. * `--help` or `-h`: Print usage and options. * `--patch-only`: An alias for `--exclude-label=semver-major,semver-minor`. +* `--paths`: Space-separated list of paths to limit the output to commits touching a subset of the repository. See https://git-scm.com/docs/git-log#_history_simplification. * `--quiet` or `-q`: Do not print to stdout. * `--repo`: Override the auto-detected GitHub repository name derived from package.json * `--require-label`: Only include commits in the list that come from a GitHub pull request with the given label. Multiple `--require-label` options may be provided, they will also be split by `,`. e.g. `--require-label=test,doc`. diff --git a/branch-diff.js b/branch-diff.js index efb8ff6..8aa74c5 100755 --- a/branch-diff.js +++ b/branch-diff.js @@ -51,7 +51,7 @@ export async function branchDiff (branch1, branch2, options) { const repoPath = options.repoPath || process.cwd() const commit = await findMergeBase(repoPath, branch1, branch2) const branchCommits = await Promise.all([branch1, branch2].map(async (branch) => { - return collect(repoPath, branch, commit, branch === branch2 && options.endRef, options.gitLogFlags) + return collect(repoPath, branch, commit, branch === branch2 && options.endRef, options.paths) })) return await diffCollected(options, branchCommits) } @@ -114,10 +114,10 @@ async function diffCollected (options, branchCommits) { return list } -async function collect (repoPath, branch, startCommit, endRef, gitLogFlags = '') { +async function collect (repoPath, branch, startCommit, endRef, paths = '') { const endrefcmd = endRef && replace(refcmd, { ref: endRef }) const untilcmd = endRef ? replace(commitdatecmd, { refcmd: endrefcmd }) : '' - const _gitcmd = replace(gitcmd, { branch, startCommit, untilcmd, gitLogFlags }) + const _gitcmd = replace(gitcmd, { branch, startCommit, untilcmd, gitLogFlags: paths ? ` -- ${paths}` : '' }) const commitList = [] await spawnCollect(_gitcmd, [], { @@ -148,6 +148,7 @@ const cliOptions = { group: { type: 'boolean', short: 'g', help: 'group commits by subsystem prefix' }, help: { type: 'boolean', short: 'h', help: 'print this help' }, 'patch-only': { type: 'boolean', help: 'alias for --exclude-label=semver-major,semver-minor' }, + 'paths': { type: 'string', help: 'space-separated list of paths to limit the output to commits touching a subset of the repository. See https://git-scm.com/docs/git-log#_history_simplification' }, quiet: { type: 'boolean', short: 'q', help: 'do not print to stdout' }, repo: { type: 'string', arg: '', help: 'GitHub repository, default derived from package.json' }, 'require-label': { type: 'string', multiple: true, arg: '', help: 'keep only commits from PRs with one of these labels' }, @@ -201,9 +202,9 @@ async function main () { } const options = { - gitLogFlags: argv['extra-git-log-flags'], group: argv.group, excludeLabels, + paths: argv.paths, requireLabels, endRef: argv['end-ref'] } From 2bdd9e53a02a03cf6c0679dfe83404f5d1d7cb5d Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 28 Nov 2026 11:43:56 +0100 Subject: [PATCH 3/6] squash! lint --- branch-diff.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/branch-diff.js b/branch-diff.js index 8aa74c5..f2efeae 100755 --- a/branch-diff.js +++ b/branch-diff.js @@ -148,7 +148,7 @@ const cliOptions = { group: { type: 'boolean', short: 'g', help: 'group commits by subsystem prefix' }, help: { type: 'boolean', short: 'h', help: 'print this help' }, 'patch-only': { type: 'boolean', help: 'alias for --exclude-label=semver-major,semver-minor' }, - 'paths': { type: 'string', help: 'space-separated list of paths to limit the output to commits touching a subset of the repository. See https://git-scm.com/docs/git-log#_history_simplification' }, + paths: { type: 'string', help: 'space-separated list of paths to limit the output to commits touching a subset of the repository. See https://git-scm.com/docs/git-log#_history_simplification' }, quiet: { type: 'boolean', short: 'q', help: 'do not print to stdout' }, repo: { type: 'string', arg: '', help: 'GitHub repository, default derived from package.json' }, 'require-label': { type: 'string', multiple: true, arg: '', help: 'keep only commits from PRs with one of these labels' }, From 50c804ee7a880b94458ddc75b13ab15be44f23d6 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 28 Nov 2026 11:59:34 +0100 Subject: [PATCH 4/6] squash! properly handle escaping --- branch-diff.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/branch-diff.js b/branch-diff.js index f2efeae..0011f5d 100755 --- a/branch-diff.js +++ b/branch-diff.js @@ -21,7 +21,9 @@ const pkgData = fs.existsSync(pkgFile) ? require(pkgFile) : {} const pkgId = pkgtoId(pkgData) const refcmd = 'git rev-list --max-count=1 {{ref}}' const commitdatecmd = '$(git show -s --format=%cd `{{refcmd}}`)' -const gitcmd = 'git log {{startCommit}}..{{branch}} --until="{{untilcmd}}"{{gitLogFlags}}' +const gitcmd = 'git log {{startCommit}}..{{branch}} --until="{{untilcmd}}"' +// Unquoted so the shell splits it on whitespace; `set -f` disables shell globbing (git will still interpret e.g. * as meaning any file). +const pathscmd = 'set -f; {{gitcmd}} -- $BRANCH_DIFF_PATHS' const ghId = { user: pkgId.user || 'nodejs', repo: pkgId.name || 'node' @@ -29,7 +31,7 @@ const ghId = { function replace (s, m) { Object.keys(m).forEach(function (k) { - s = s.replace(new RegExp('\\{\\{' + k + '\\}\\}', 'g'), m[k]) + s = s.replace(new RegExp('\\{\\{' + k + '\\}\\}', 'g'), () => m[k]) }) return s } @@ -51,7 +53,9 @@ export async function branchDiff (branch1, branch2, options) { const repoPath = options.repoPath || process.cwd() const commit = await findMergeBase(repoPath, branch1, branch2) const branchCommits = await Promise.all([branch1, branch2].map(async (branch) => { - return collect(repoPath, branch, commit, branch === branch2 && options.endRef, options.paths) + return branch === branch2 + ? collect(repoPath, branch, commit, options.endRef, options.paths) + : collect(repoPath, branch, commit) })) return await diffCollected(options, branchCommits) } @@ -117,12 +121,15 @@ async function diffCollected (options, branchCommits) { async function collect (repoPath, branch, startCommit, endRef, paths = '') { const endrefcmd = endRef && replace(refcmd, { ref: endRef }) const untilcmd = endRef ? replace(commitdatecmd, { refcmd: endrefcmd }) : '' - const _gitcmd = replace(gitcmd, { branch, startCommit, untilcmd, gitLogFlags: paths ? ` -- ${paths}` : '' }) + const logcmd = replace(gitcmd, { branch, startCommit, untilcmd }) + const _gitcmd = paths.trim() ? replace(pathscmd, { gitcmd: logcmd }) : logcmd const commitList = [] await spawnCollect(_gitcmd, [], { shell: true, cwd: repoPath, + // Passing it through the env to short-circuit the shell, in case it contains e.g. `$` + env: { ...process.env, BRANCH_DIFF_PATHS: paths }, stdio: ['ignore', 'pipe', 'inherit'] }, (stdout) => pipeline( stdout, @@ -148,7 +155,7 @@ const cliOptions = { group: { type: 'boolean', short: 'g', help: 'group commits by subsystem prefix' }, help: { type: 'boolean', short: 'h', help: 'print this help' }, 'patch-only': { type: 'boolean', help: 'alias for --exclude-label=semver-major,semver-minor' }, - paths: { type: 'string', help: 'space-separated list of paths to limit the output to commits touching a subset of the repository. See https://git-scm.com/docs/git-log#_history_simplification' }, + paths: { type: 'string', arg: '

', help: 'only list commits touching\nthese space-separated git pathspecs' }, quiet: { type: 'boolean', short: 'q', help: 'do not print to stdout' }, repo: { type: 'string', arg: '', help: 'GitHub repository, default derived from package.json' }, 'require-label': { type: 'string', multiple: true, arg: '', help: 'keep only commits from PRs with one of these labels' }, From 0bf15d30042e7cb1d8c88d8666c022f4d10eb4cb Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 28 Nov 2026 12:00:38 +0100 Subject: [PATCH 5/6] squash! add tests --- test.js | 75 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 64 insertions(+), 11 deletions(-) diff --git a/test.js b/test.js index 420f033..3581297 100644 --- a/test.js +++ b/test.js @@ -1,9 +1,9 @@ import { test, before, after } from 'node:test' import assert from 'node:assert/strict' import { execFile } from 'node:child_process' -import { mkdtemp, readFile, rm } from 'node:fs/promises' +import { access, mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises' import { tmpdir, devNull } from 'node:os' -import { join } from 'node:path' +import { dirname, join } from 'node:path' import { promisify, stripVTControlCharacters } from 'node:util' import { fileURLToPath } from 'node:url' @@ -29,7 +29,12 @@ async function git (...args) { // Each commit gets a later date than the last so `--until` (used by // `--end-ref`) is deterministic. -async function commit (summary, { body = [], author = 'Alice ' } = {}) { +async function commit (summary, { body = [], author = 'Alice ', files = [] } = {}) { + for (const file of files) { + await mkdir(join(repo, dirname(file)), { recursive: true }) + await writeFile(join(repo, file), `${summary}\n`, { flag: 'a' }) + await git('add', file) + } const date = new Date(Date.UTC(2026, 0, 1) + (++tick) * 60_000).toISOString() const [, name, email] = author.match(/^(.+) <(.+)>$/) await execFileP('git', ['commit', '--allow-empty', '-q', '-m', summary, ...body.flatMap((b) => ['-m', b])], { @@ -64,21 +69,22 @@ before(async () => { await commit('build: shared base') await git('checkout', '-q', '-b', 'release') - await commit('fs: backport with matching PR-URL', { body: ['PR-URL: https://example.com/pr/1'] }) + await commit('fs: backport with matching PR-URL', { body: ['PR-URL: https://example.com/pr/1'], files: ['lib/fs.js'] }) await commit('net: backport matched by author') - await commit('doc: same summary, different PR-URL', { body: ['PR-URL: https://example.com/pr/3'] }) - await commit('test: only on release') + await commit('doc: same summary, different PR-URL', { body: ['PR-URL: https://example.com/pr/3'], files: ['doc/a.md'] }) + await commit('test: only on release', { files: ['test/only-release.js'] }) await git('checkout', '-q', 'main') - await commit('fs: backport with matching PR-URL', { body: ['PR-URL: https://example.com/pr/1/'] }) + // The release backport above dropped the test change. + await commit('fs: backport with matching PR-URL', { body: ['PR-URL: https://example.com/pr/1/'], files: ['lib/fs.js', 'test/fs.js'] }) await commit('net: backport matched by author') - await commit('doc: same summary, different PR-URL', { body: ['PR-URL: https://example.com/pr/4'] }) - await commit('net: backport matched by author', { author: 'Bob ' }) + await commit('doc: same summary, different PR-URL', { body: ['PR-URL: https://example.com/pr/4'], files: ['doc/a.md'] }) + await commit('net: backport matched by author', { author: 'Bob ', files: ['lib/net.js'] }) await commit('net: backport matched by author', { author: 'Alice ' }) - await commit('crypto: only on main') + await commit('crypto: only on main', { files: ['lib/crypto.js'] }) await commit('2026-01-02, Version 1.0.0 (Current)') await commit('Working on v1.0.1') - await commit('lib: after end ref') + await commit('lib: after end ref', { files: ['lib/after.js'] }) }) after(() => rm(repo, { recursive: true, force: true })) @@ -134,6 +140,53 @@ test('--group orders commits by subsystem', async () => { ]) }) +test('--paths limits the output to commits touching the given path', async () => { + assert.deepEqual(await summaries('release', 'main', '--paths=lib'), [ + 'lib: after end ref', + 'crypto: only on main', + 'net: backport matched by author' + ]) +}) + +test('--paths accepts a space-separated list', async () => { + assert.deepEqual(await summaries('release', 'main', '--paths=doc lib/crypto.js'), [ + 'crypto: only on main', + 'doc: same summary, different PR-URL' + ]) +}) + +test('--paths combines with --end-ref', async () => { + assert.deepEqual(await summaries('release', 'main', '--paths=lib', '--end-ref=main~1'), [ + 'crypto: only on main', + 'net: backport matched by author' + ]) +}) + +test('--paths matching nothing prints nothing', async () => { + assert.deepEqual(await branchDiff('release', 'main', '--paths=nope'), []) +}) + +test('--paths does not hide backports that touched fewer files', async () => { + // main's fs commit touches test/fs.js, its backport on release does not. + assert.deepEqual(await summaries('release', 'main', '--paths=test'), []) +}) + +test('--paths globs are git pathspecs, not shell globs', async () => { + // The working tree is main, which has test/fs.js but not test/only-release.js. + assert.deepEqual(await summaries('main', 'release', '--paths=test/*.js'), ['test: only on release']) +}) + +test('--paths supports pathspec magic', async () => { + assert.deepEqual(await summaries('release', 'main', '--paths=:(exclude)lib'), [ + 'doc: same summary, different PR-URL' + ]) +}) + +test('--paths is not evaluated by the shell', async () => { + await summaries('release', 'main', '--paths=lib $(touch pwned) `touch pwned`; touch pwned') + await assert.rejects(access(join(repo, 'pwned'))) +}) + test('--version prints the package version', async () => { const { version } = JSON.parse(await readFile(new URL('./package.json', import.meta.url))) assert.deepEqual(await branchDiff('--version'), [`v ${version}`]) From e4c35ce9adba78fc0dc94a3fbbb98ca050ec3991 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 30 Nov 2026 11:46:02 +0100 Subject: [PATCH 6/6] squash! move to multiple `--path` --- README.md | 2 +- branch-diff.js | 12 +++++------- test.js | 36 ++++++++++++++++++++---------------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 0974914..61e4b2c 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ But the comparison isn't quite as strict, generally leading to a shorter list of * `--group` or `-g`: Group commits by prefix, this uses the part of the commit summary that is usually used in Node.js core to indicate subsystem for example. Groups are made up of numbers, letters, `,` and `-`, followed by a `:`. * `--help` or `-h`: Print usage and options. * `--patch-only`: An alias for `--exclude-label=semver-major,semver-minor`. -* `--paths`: Space-separated list of paths to limit the output to commits touching a subset of the repository. See https://git-scm.com/docs/git-log#_history_simplification. +* `--path`: Path to limit the output to commits touching a subset of the repository. Can be passed multiple times. See https://git-scm.com/docs/git-log#_history_simplification. * `--quiet` or `-q`: Do not print to stdout. * `--repo`: Override the auto-detected GitHub repository name derived from package.json * `--require-label`: Only include commits in the list that come from a GitHub pull request with the given label. Multiple `--require-label` options may be provided, they will also be split by `,`. e.g. `--require-label=test,doc`. diff --git a/branch-diff.js b/branch-diff.js index 0011f5d..dec57d6 100755 --- a/branch-diff.js +++ b/branch-diff.js @@ -22,8 +22,6 @@ const pkgId = pkgtoId(pkgData) const refcmd = 'git rev-list --max-count=1 {{ref}}' const commitdatecmd = '$(git show -s --format=%cd `{{refcmd}}`)' const gitcmd = 'git log {{startCommit}}..{{branch}} --until="{{untilcmd}}"' -// Unquoted so the shell splits it on whitespace; `set -f` disables shell globbing (git will still interpret e.g. * as meaning any file). -const pathscmd = 'set -f; {{gitcmd}} -- $BRANCH_DIFF_PATHS' const ghId = { user: pkgId.user || 'nodejs', repo: pkgId.name || 'node' @@ -118,18 +116,18 @@ async function diffCollected (options, branchCommits) { return list } -async function collect (repoPath, branch, startCommit, endRef, paths = '') { +async function collect (repoPath, branch, startCommit, endRef, paths = []) { const endrefcmd = endRef && replace(refcmd, { ref: endRef }) const untilcmd = endRef ? replace(commitdatecmd, { refcmd: endrefcmd }) : '' const logcmd = replace(gitcmd, { branch, startCommit, untilcmd }) - const _gitcmd = paths.trim() ? replace(pathscmd, { gitcmd: logcmd }) : logcmd + const _gitcmd = paths.length ? `${logcmd} -- ${paths.map((_, i) => `"$BRANCH_DIFF_PATH_${i}"`).join(' ')}` : logcmd const commitList = [] await spawnCollect(_gitcmd, [], { shell: true, cwd: repoPath, // Passing it through the env to short-circuit the shell, in case it contains e.g. `$` - env: { ...process.env, BRANCH_DIFF_PATHS: paths }, + env: { ...process.env, ...Object.fromEntries(paths.map((val, i) => [`BRANCH_DIFF_PATH_${i}`, val])) }, stdio: ['ignore', 'pipe', 'inherit'] }, (stdout) => pipeline( stdout, @@ -155,7 +153,7 @@ const cliOptions = { group: { type: 'boolean', short: 'g', help: 'group commits by subsystem prefix' }, help: { type: 'boolean', short: 'h', help: 'print this help' }, 'patch-only': { type: 'boolean', help: 'alias for --exclude-label=semver-major,semver-minor' }, - paths: { type: 'string', arg: '

', help: 'only list commits touching\nthese space-separated git pathspecs' }, + path: { type: 'string', multiple: true, arg: '

', help: 'only list commits touching\nthis git pathspec' }, quiet: { type: 'boolean', short: 'q', help: 'do not print to stdout' }, repo: { type: 'string', arg: '', help: 'GitHub repository, default derived from package.json' }, 'require-label': { type: 'string', multiple: true, arg: '', help: 'keep only commits from PRs with one of these labels' }, @@ -211,7 +209,7 @@ async function main () { const options = { group: argv.group, excludeLabels, - paths: argv.paths, + paths: argv.path, requireLabels, endRef: argv['end-ref'] } diff --git a/test.js b/test.js index 3581297..a637a6b 100644 --- a/test.js +++ b/test.js @@ -140,50 +140,54 @@ test('--group orders commits by subsystem', async () => { ]) }) -test('--paths limits the output to commits touching the given path', async () => { - assert.deepEqual(await summaries('release', 'main', '--paths=lib'), [ +test('--path limits the output to commits touching the given path', async () => { + assert.deepEqual(await summaries('release', 'main', '--path=lib'), [ 'lib: after end ref', 'crypto: only on main', 'net: backport matched by author' ]) }) -test('--paths accepts a space-separated list', async () => { - assert.deepEqual(await summaries('release', 'main', '--paths=doc lib/crypto.js'), [ +test('--path accepts paths containing a space', async () => { + assert.deepEqual(await summaries('release', 'main', '--path=doc lib/crypto.js'), []) +}) + +test('--path can be passed multiple times', async () => { + assert.deepEqual(await summaries('release', 'main', '--path=doc', '--path=lib/crypto.js'), [ 'crypto: only on main', 'doc: same summary, different PR-URL' ]) }) -test('--paths combines with --end-ref', async () => { - assert.deepEqual(await summaries('release', 'main', '--paths=lib', '--end-ref=main~1'), [ +test('--path combines with --end-ref', async () => { + assert.deepEqual(await summaries('release', 'main', '--path=lib', '--end-ref=main~1'), [ 'crypto: only on main', 'net: backport matched by author' ]) }) -test('--paths matching nothing prints nothing', async () => { - assert.deepEqual(await branchDiff('release', 'main', '--paths=nope'), []) +test('--path matching nothing prints nothing', async () => { + assert.deepEqual(await branchDiff('release', 'main', '--path=nope'), []) }) -test('--paths does not hide backports that touched fewer files', async () => { +test('--path does not hide backports that touched fewer files', async () => { // main's fs commit touches test/fs.js, its backport on release does not. - assert.deepEqual(await summaries('release', 'main', '--paths=test'), []) + assert.deepEqual(await summaries('release', 'main', '--path=test'), []) }) -test('--paths globs are git pathspecs, not shell globs', async () => { +test('--path globs are git pathspecs, not shell globs', async () => { // The working tree is main, which has test/fs.js but not test/only-release.js. - assert.deepEqual(await summaries('main', 'release', '--paths=test/*.js'), ['test: only on release']) + assert.deepEqual(await summaries('main', 'release', '--path=test/*.js'), ['test: only on release']) }) -test('--paths supports pathspec magic', async () => { - assert.deepEqual(await summaries('release', 'main', '--paths=:(exclude)lib'), [ +test('--path supports pathspec magic', async () => { + assert.deepEqual(await summaries('release', 'main', '--path=:(exclude)lib'), [ 'doc: same summary, different PR-URL' ]) }) -test('--paths is not evaluated by the shell', async () => { - await summaries('release', 'main', '--paths=lib $(touch pwned) `touch pwned`; touch pwned') +test('--path is not evaluated by the shell', async () => { + await summaries('release', 'main', '--path=lib $(touch pwned) `touch pwned`; touch pwned') await assert.rejects(access(join(repo, 'pwned'))) })