From d811d16d24150eddd47986eebbeedc9e8d1d25d5 Mon Sep 17 00:00:00 2001 From: RouxAntoine Date: Sun, 25 Feb 2024 23:07:57 +0100 Subject: [PATCH] fix: support initial commit in case of initialization from empty changelog list --- script.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script.sh b/script.sh index 4b1beed..53e3c8a 100755 --- a/script.sh +++ b/script.sh @@ -16,11 +16,11 @@ if [ -z "$noRelease" ]; then lastVersion=$(changie latest) lastSeenCommit=$(cat .changes/$lastVersion.md | grep --only-matching --max-count 1 -E '\b[0-9a-f]{5,40}\b') -else - lastSeenCommit=$(git rev-list --max-parents=0 HEAD --abbrev-commit) -fi -commit=$(git log --oneline --pretty=format:'%h - %s' --abbrev-commit $lastSeenCommit..HEAD) + commit=$(git log --no-merges --oneline --pretty=format:'%h - %s' --abbrev-commit $lastSeenCommit..HEAD) +else + commit=$(git log --no-merges --oneline --pretty=format:'%h - %s' --abbrev-commit) +fi # deal with case of no new commit if [ -n "$commit" ]; then