Skip to content

Commit cc1bc9b

Browse files
committed
[no-relnote] Fix generate changelog script
Signed-off-by: Evan Lezar <[email protected]>
1 parent 2be357b commit cc1bc9b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

hack/generate-changelog.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ this=`basename $0`
2020
usage () {
2121
cat << EOF
2222
Generate a changelog for the specified tag
23-
Usage: $this --reference <tag> [--remote <remote_name>]
23+
Usage: $this --since <tag> [--remote <remote_name>]
2424
2525
Options:
2626
--since specify the tag to start the changelog from (default: latest tag)
@@ -70,10 +70,15 @@ if [ -z "$REFERENCE" ]; then
7070
fi
7171
fi
7272

73+
SHA=$(git rev-parse ${VERSION})
74+
if [[ $? -ne 0 ]]; then
75+
SHA="HEAD"
76+
fi
77+
7378
# Print the changelog
7479
echo "## Changelog"
7580
echo ""
7681
echo "### Version $VERSION"
7782

7883
# Iterate over the commit messages and ignore the ones that start with "Merge" or "Bump"
79-
git log --pretty=format:"%s" $REFERENCE..@ | grep -Ev "(^Merge )|(^Bump)|(no-rel-?note)|(^---)" | sed 's/^\(.*\)/- \1/g'
84+
git log --pretty=format:"%s" $REFERENCE..$SHA | grep -Ev "(^Merge )|(^Bump)|(no-rel-?note)|(^---)" | sed 's/^\(.*\)/- \1/g'

0 commit comments

Comments
 (0)