Path: blob/main/sys/contrib/device-tree/scripts/merge-new-release.sh
48254 views
#!/bin/bash12case $1 in3v*-dts) ;;4'')5echo >&2 "No version given"6exit 17;;8*)9echo >&2 "Unexpected version: $1"10exit 111;;12esac1314v=$11516set -e1718# Use the date of Linus' originally tagged commit for the merge. This might19# differ from what the commit that the rewritten tag points to, since the20# orignal commit may have been discarded.21export GIT_AUTHOR_DATE=$(git log -1 --format=%ad "${v%-dts}")22if [ ! "${GIT_AUTHOR_DATE}" ] ; then23echo >&2 "Unable to determine commit date for merge"24exit 125fi26if [ "${v}" = "v2.6.12-rc2-dts" ] ; then27auh="--allow-unrelated-histories"28fi29git merge $auh --no-edit "${v}-raw"30git clean -fdqx31# Use the date of Linus' original tag for the tag.32case "${v%-dts}" in33v2.6.12*|v2.6.13-rc[123])34# Commits from v2.6.12-rc2..v2.6.13-rc3 lacked the date. So use the commit's35# date.36export GIT_COMMITTER_DATE="${GIT_AUTHOR_DATE}"37;;38*)39export GIT_COMMITTER_DATE="$(git for-each-ref --format='%(taggerdate)' "refs/tags/${v%-dts}")"40;;41esac42if [ ! "${GIT_COMMITTER_DATE}" ] ; then43echo >&2 "Unable to determine date for tag"44exit 145fi46git tag -s -m "Tagging ${v}" -u 695A46C6 "${v}"47make -k -j12 -s484950