From 573804aa4c0300a7cd41be093abd915d1877859a Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 10 May 2021 16:44:39 -0700 Subject: [PATCH] fix(mkreleaselog): handle commit 0 At commit 0, there is no parent. --- bin/mkreleaselog | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/mkreleaselog b/bin/mkreleaselog index bcc4f3255..48173fc16 100755 --- a/bin/mkreleaselog +++ b/bin/mkreleaselog @@ -120,8 +120,10 @@ release_log() { "$start..$end" | while read commit subject; do # Skip gx-only PRs. - git -C "$dir" diff-tree --no-commit-id --name-only "$commit^" "$commit" | - grep -v "${IGNORED_FILES}" >/dev/null || continue + if git rev-parse '$commit^' >/dev/null 2>&1 && + ! git -C "$dir" diff-tree --no-commit-id --name-only "$commit^" "$commit" | grep -v "${IGNORED_FILES}" >/dev/null; then + continue + fi if [[ "$subject" =~ '^Merge pull request #([0-9]+) from' ]]; then local prnum="${BASH_REMATCH[2]}"