Fix backport author format

Makes the merge exist as the original author, with the merger and
backporter listed in the commit body. Also adjust the order to make it a
bit nicer to read (IMO).
This commit is contained in:
Joshua Boniface 2022-08-02 23:52:23 -04:00
parent 46be780396
commit dcea3fb874

View File

@ -84,13 +84,14 @@ for pr in ${backport_pr_list}; do
merge_title="$( hub pr show -f '%t' ${pr} 2>/dev/null )"
merge_author="$( git show -s --format='%an <%ae>' ${merge_commit}^2 )"
merge_committer="$( git show -s --format='%an <%ae>' ${merge_commit} )"
merge_backporter="$( git config --global user.name ) <$( git config --global user.email )>"
echo "Parsing ${merge_commit} for ${pr}..."
git cherry-pick -sxn -m1 ${merge_commit}
if [[ $? -ne 0 ]]; then
echo "Issue with merge! Review the changes in another terminal, run 'git add', then press <Enter>."
read
fi
git commit -m "Backport pull request #${pr} from jellyfin/${release_branch}" -m "${merge_title}" -m "Authored-by: ${merge_author}" -m "Merged-by: ${merge_committer}" -m "Original-merge: ${merge_commit}"
git commit -m "Backport pull request #${pr} from jellyfin/${release_branch}" --author="${merge_author}" -m "${merge_title}" -m "Original-merge: ${merge_commit}" -m "Merged-by: ${merge_committer}" -m "Backported-by: ${merge_backporter}"
done
echo