From 409b891b5f523c91af2c3b9d27386b386aec914b Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 3 Aug 2026 14:31:41 +0000 Subject: [PATCH] fix(@stdlib/_tools): disambiguate path in `changelog/parse-commits` `git log` The `standalone_push_changes` workflow crashed publishing a batch of 19 packages: `git log ... "$dir"` in `commits.sh` was invoked without a `--` pathspec separator. When `$dir` no longer exists in the working tree (e.g. a package deleted from the monorepo in an earlier commit), `git log` fails hard with "ambiguous argument ... unknown revision or path not in the working tree", exiting non-zero with no stdout. The Node.js caller discards stderr and never checks the exit code, so this silently returns zero commits, which then throws `Unable to parse commits for package` uncaught, crashing the whole publish batch instead of just the affected package. This commit adds `--` before the path argument so `git log` always treats it as a pathspec rather than attempting to also resolve it as a revision, matching standard Git usage. Verified this returns the deleted package's history correctly while producing byte-identical output for existing package directories (including the root `lib/node_modules/@stdlib` case) and the "unresolvable directory" test case. Ref: https://github.com/stdlib-js/stdlib/actions/runs/30804159359 --- .../@stdlib/_tools/changelog/parse-commits/scripts/commits.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/_tools/changelog/parse-commits/scripts/commits.sh b/lib/node_modules/@stdlib/_tools/changelog/parse-commits/scripts/commits.sh index fae7c888b62c..93aa00f938b8 100755 --- a/lib/node_modules/@stdlib/_tools/changelog/parse-commits/scripts/commits.sh +++ b/lib/node_modules/@stdlib/_tools/changelog/parse-commits/scripts/commits.sh @@ -38,4 +38,4 @@ if [ -z "$GIT_COMMIT_SEP" ]; then GIT_COMMIT_SEP="^---^"; # Default separator fi -git log "${@:2}" --name-only --no-merges --notes --pretty=format:"%H|%ad|%aN <%aE>|%B|%N|" "$1" | awk -v sep="$GIT_COMMIT_SEP" '/^$/{p=1;next} /^[0-9a-f]{40}\|/{if (p==1) print sep; p=0} {print}'; +git log "${@:2}" --name-only --no-merges --notes --pretty=format:"%H|%ad|%aN <%aE>|%B|%N|" -- "$1" | awk -v sep="$GIT_COMMIT_SEP" '/^$/{p=1;next} /^[0-9a-f]{40}\|/{if (p==1) print sep; p=0} {print}';