diff options
| author | Natalia <124304+nessita@users.noreply.github.com> | 2025-11-20 12:31:59 -0300 |
|---|---|---|
| committer | Natalia <124304+nessita@users.noreply.github.com> | 2025-11-21 15:37:36 -0300 |
| commit | aa8cbe051dfbc5ff3afe5f27c9ba965fbee7d747 (patch) | |
| tree | 59952805de5e1d15a42491a646e228022dee5ac4 /scripts/backport.sh | |
| parent | ab8ba62dbbfe7f75b05b5f24128f812fd750e88a (diff) | |
[6.0.x] Added scripts for building and releasing Django artifacts.
Backport of a523d5c8336f5f7f5e24a1cc8034ce65aedec3c6 from main.
Diffstat (limited to 'scripts/backport.sh')
| -rwxr-xr-x | scripts/backport.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/backport.sh b/scripts/backport.sh new file mode 100755 index 0000000000..6c98697564 --- /dev/null +++ b/scripts/backport.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Backport helper for Django stable branches. + +set -xue + +if [ -z $1 ]; then + echo "Full hash of commit to backport is required." + exit +fi + +BRANCH_NAME=`git branch | sed -n '/\* stable\//s///p'` +echo $BRANCH_NAME + +# Ensure clean working directory +git reset --hard + +REV=$1 + +TMPFILE=tmplog.tmp + +# Cherry-pick the commit +git cherry-pick ${REV} + +# Create new log message by modifying the old one +git log --pretty=format:"[${BRANCH_NAME}] %s%n%n%b%nBackport of ${REV} from main." HEAD^..HEAD \ + | grep -v '^BP$' > ${TMPFILE} + +# Commit new log message +git commit --amend -F ${TMPFILE} + +# Clean up temporary files +rm -f ${TMPFILE} + +git show |
