OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright 2014 Google Inc. | 2 # Copyright 2014 Google Inc. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Crude script to clone the git skia repo into the current directory, which | 7 # Crude script to clone the git skia repo into the current directory, which |
8 # must be a CitC client. | 8 # must be a CitC client. |
9 # | 9 # |
10 # Usage: | 10 # Usage: |
11 # ./tools/git_clone_to_google3.sh | 11 # ./tools/git_clone_to_google3.sh |
12 | 12 |
13 prodcertstatus -q || (echo "Please run prodaccess." 1>&2; exit 1) | 13 prodcertstatus -q || (echo "Please run prodaccess." 1>&2; exit 1) |
14 source gbash.sh || exit 2 | 14 source gbash.sh || exit 2 |
15 | 15 |
16 DEFINE_string skia_rev "" "Git hash of Skia revision to clone, default LKGR." | 16 DEFINE_string skia_rev "" "Git hash of Skia revision to clone, default latest." |
17 gbash::init_google "$@" | 17 gbash::init_google "$@" |
18 | 18 |
19 set -e | 19 set -e |
20 | 20 |
21 # Checkout LKGR of Skia in a temp location. | 21 # Checkout specified revision of Skia in a temp location. |
22 TMP=$(gbash::make_temp_dir) | 22 TMP=$(gbash::make_temp_dir) |
23 pushd "${TMP}" | 23 pushd "${TMP}" |
24 git clone https://skia.googlesource.com/skia | 24 git clone https://skia.googlesource.com/skia |
25 cd skia | 25 cd skia |
26 git fetch | 26 git fetch |
27 if [ -z "${FLAGS_skia_rev}" ]; then | 27 if [[ -z "${FLAGS_skia_rev}" ]]; then |
28 # Retrieve last known good revision. | 28 # Retrieve latest revision. |
29 MY_DIR="$(gbash::get_absolute_caller_dir)" | 29 FLAGS_skia_rev="$(git show --format=%H --no-patch origin/master)" |
30 FLAGS_skia_rev="$(${MY_DIR}/get_skia_lkgr.sh)" | |
31 fi | 30 fi |
32 git checkout --detach "${FLAGS_skia_rev}" | 31 git checkout --detach "${FLAGS_skia_rev}" |
33 | 32 |
34 # Rsync to google3 location. | 33 # Rsync to google3 location. |
35 popd | 34 popd |
36 # Use multichange client in case there are too many files for nomultichange. htt
p://b/7292343 | 35 # Use multichange client in case there are too many files for nomultichange. htt
p://b/7292343 |
37 g4 client --set_option multichange | 36 g4 client --set_option multichange |
38 # Use allwrite to simplify opening the correct files after rsync. | 37 # Use allwrite to simplify opening the correct files after rsync. |
39 g4 client --set_option allwrite | 38 g4 client --set_option allwrite |
40 # Filter directories added to CitC. | 39 # Filter directories added to CitC. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 # will always change them to Unix line endings. | 87 # will always change them to Unix line endings. |
89 git update-index --skip-worktree make.bat | 88 git update-index --skip-worktree make.bat |
90 git update-index --skip-worktree make.py | 89 git update-index --skip-worktree make.py |
91 | 90 |
92 # Tell git to ignore files left out of the rsync (i.e. "deleted" files). | 91 # Tell git to ignore files left out of the rsync (i.e. "deleted" files). |
93 git status --porcelain | \ | 92 git status --porcelain | \ |
94 grep -e "^ D" | \ | 93 grep -e "^ D" | \ |
95 cut -c 4- | \ | 94 cut -c 4- | \ |
96 xargs git update-index --skip-worktree | 95 xargs git update-index --skip-worktree |
97 | 96 |
OLD | NEW |