blob: ea3c22e8bbf0f574ac1b04fbb2d9812edc1ad05e [file] [log] [blame]
# update-spirvtools merges the latest changes from
# the into third_party/SPIRV-Tools.
# This script copies the change descriptions from the squash change into the
# top merge change, along with a standardized description.
if [ ! -z "$REASON" ]; then
THIRD_PARTY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"
GIT_RESULT=`git subtree pull --prefix third_party/SPIRV-Tools master --squash -m "Update SPIR-V Tools"`
if [[ $GIT_RESULT == *"CONFLICT"* ]]; then
echo "subtree pull resulted in conflicts. Atempting to automatically resolve..."
# CONFLICT is very likely due to being deleted in our third_party.
# Delete it, and try to continue.
git rm ${THIRD_PARTY_DIR}/SPIRV-Tools/
git -c core.editor=true merge --continue # '-c core.editor=true' prevents the editor from showing
if [ $? -ne 0 ]; then
echo "Could not automatically resolve conflicts."
exit 1
ALL_CHANGES=`git log -n 1 HEAD^2 | egrep '^(\s{4}[0-9a-f]{9}\s*.*)$'`
HEAD_CHANGE=`echo "$ALL_CHANGES" | egrep '[0-9a-f]{9}' -o -m 1`
LOG_MSG=`echo -e "Update SPIR-V Tools to $HEAD_CHANGE\n${REASON}\nChanges:\n$ALL_CHANGES\n\nCommands:\n ./third_party/\n\nBug: b/123642959"`
git commit --amend -m "$LOG_MSG"