#!/bin/sh

OLD_VERSION_TAG=$1
NEW_VERSION=$(echo "$2" | cut -c 8-)

# generate changelog entries from git
gbp dch --git-author --id-length=7 --since="$OLD_VERSION_TAG" --new-version="$NEW_VERSION" --ignore-branch

# copy release from last version
EDITOR=true dch -r --no-force-save-on-release

git add debian/changelog
git commit -m "d/changelog: Add changelog entries for v$NEW_VERSION"
