Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make previous version optional in source_changelog.bash #1012

Merged
merged 2 commits into from
Oct 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions source-repo-scripts/source_changelog.bash
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#!/bin/bash
# Generates a list of changes since the last tagged version.
# bash source_changelog.bash
#
# Optionally, the previous version can be provided
# bash source_changelog.bash <PREV_VER>

PREV_VER=$1
#
# E.g.
# bash source_changelog.bash 3.0.0

git fetch --tags

PREV_VER=${1:-$(git describe --tags --abbrev=0 | sed 's/.*_//')}
echo "Changes since $PREV_VER"

ORIGIN_URL=$(git remote get-url origin)
REPO=$(basename ${ORIGIN_URL%.git})

Expand All @@ -14,7 +22,7 @@ PREV_TAG=$(git tag | grep "_${PREV_VER}$")
# Compare current branch to PREV_TAG
BRANCH=$(git rev-parse --abbrev-ref HEAD)

COMMITS=$(git log ${BRANCH}...${PREV_TAG} --pretty=format:"%h")
COMMITS=$(git log ${BRANCH}...${PREV_TAG} --no-merges --pretty=format:"%h")

for COMMIT in $COMMITS
do
Expand Down