Skip to content

Commit

Permalink
Support gz- repos on source_changelog script (#741)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <louise@openrobotics.org>
  • Loading branch information
chapulina authored Jun 17, 2022
1 parent 72777a6 commit 266d108
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions source-repo-scripts/source_changelog.bash
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
#!/bin/bash
# bash source_changelog.bash <PREV_VER>

PREV_TAG=$1

git fetch --tags

REPO=$(basename `git rev-parse --show-toplevel`)
REPO_FULL="${REPO/ign-/ignition-}"
REPO="${REPO/ign-/gz-}"
MAJOR=${PREV_TAG%.*.*}
BRANCH=${REPO/sdformat/sdf}${MAJOR}
TAG="${REPO}${MAJOR}"

COMMITS=$(git log ${BRANCH}...${REPO_FULL}${MAJOR}_${PREV_TAG} --pretty=format:"%h")
# TODO(chapulina) Support Garden tags and branches, which will start with gz-
TAG="${TAG/gz-/ignition-}"
TAG="${TAG/sim/gazebo}"
BRANCH="${BRANCH/gz-/ign-}"
BRANCH="${BRANCH/sim/gazebo}"

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

for COMMIT in $COMMITS
do
Expand All @@ -19,6 +27,6 @@ do
PR=${PR%)}

echo "1. $TITLE"
echo " * [Pull request #$PR](https://github.com/ignitionrobotics/$REPO/pull/$PR)"
echo " * [Pull request #$PR](https://github.com/gazebosim/$REPO/pull/$PR)"
echo ""
done

0 comments on commit 266d108

Please sign in to comment.