+ # Add to each commit Link: https://github.com/openwrt/openwrt/pull/$PRID
+ if ! $GIT filter-repo --message-callback "
+ return message + b\"Link: https://github.com/openwrt/openwrt/pull/$PRID\"
+ " --refs $BRANCH..$LOCAL_PR_BRANCH; then
+ echo "Failed to add Link: Pull Request tag" >&2
+ exit 9
+ fi
+
+ # Remove any previous SoB tag if the Pull Request Author and Committer match
+ if ! $GIT filter-repo --message-callback "
+ return message.replace(b\"Signed-off-by: $(git config user.name) <$(git config user.email)>\",b\"\")
+ " --refs $BRANCH..$LOCAL_PR_BRANCH; then
+ echo "Failed to remove previous Committer SoB tag" >&2
+ exit 9
+ fi
+
+ # Add Committer SoB to better reference who merged the thing last
+ if ! $GIT rebase origin/$BRANCH $LOCAL_PR_BRANCH --exec "git commit -s --amend -C HEAD"; then
+ echo "Failed to add Committer SoB tag" >&2
+ exit 9
+ fi
+