blob: 8fbcac531525620480a18c176c70968192123db6 [file] [log] [blame]
Ryan Harrisonda8223d2019-06-19 15:04:09 +00001#!/usr/bin/env bash
2
3# Copyright 2019 The Dawn Authors
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
Ryan Harrisona84ab482020-06-17 23:52:19 +000017# Attempts to roll all entries in DEPS to tip-of-tree and create a commit.
Ryan Harrisonda8223d2019-06-19 15:04:09 +000018#
19# Depends on roll-dep from depot_path being in PATH.
20
Ryan Harrisona84ab482020-06-17 23:52:19 +000021spirv_cross_dir="third_party/spirv-cross/"
22spirv_cross_trunk="origin/master"
23spirv_headers_dir="third_party/spirv-headers/"
24spirv_headers_trunk="origin/master"
Ryan Harrison92554d72020-07-06 21:31:00 +000025spirv_tools_dir="third_party/SPIRV-Tools/"
Ryan Harrisona84ab482020-06-17 23:52:19 +000026spirv_tools_trunk="origin/master"
27tint_dir="third_party/tint/"
28tint_trunk="origin/main"
29
Ryan Harrisonda8223d2019-06-19 15:04:09 +000030# This script assumes it's parent directory is the repo root.
31repo_path=$(dirname "$0")/..
32
Ryan Harrisonda8223d2019-06-19 15:04:09 +000033cd "$repo_path"
34
Ryan Harrisona84ab482020-06-17 23:52:19 +000035if [[ $(git diff --stat) != '' ]]; then
36 echo "Working tree is dirty, commit changes before attempting to roll DEPS"
37 exit 1
38fi
39
40old_head=$(git rev-parse HEAD)
41
Ryan Harrisona84ab482020-06-17 23:52:19 +000042roll-dep --ignore-dirty-tree --roll-to="${spirv_cross_trunk}" "${spirv_cross_dir}"
43roll-dep --ignore-dirty-tree --roll-to="${spirv_headers_trunk}" "${spirv_headers_dir}"
44roll-dep --ignore-dirty-tree --roll-to="${spirv_tools_trunk}" "${spirv_tools_dir}"
45roll-dep --ignore-dirty-tree --roll-to="${tint_trunk}" "${tint_dir}"
46
47git rebase --interactive "${old_head}"