| 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 source gbash.sh || exit | 13 prodcertstatus -q || (echo "Please run prodaccess." 1>&2; exit 1) |
| 14 source gbash.sh || exit 2 |
| 15 |
| 14 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 LKGR." |
| 15 gbash::init_google "$@" | 17 gbash::init_google "$@" |
| 16 | 18 |
| 17 set -x -e | 19 set -e |
| 18 | |
| 19 # To run this script after making edits, run: | |
| 20 # g4 revert -k git_clone_to_google3.sh | |
| 21 # To get the file back into your CL, run: | |
| 22 # g4 edit git_clone_to_google3.sh | |
| 23 #g4 opened | grep -q "//depot" && gbash::die "Must run in a clean client." | |
| 24 | 20 |
| 25 # Checkout LKGR of Skia in a temp location. | 21 # Checkout LKGR of Skia in a temp location. |
| 26 TMP=$(gbash::make_temp_dir) | 22 TMP=$(gbash::make_temp_dir) |
| 27 pushd "${TMP}" | 23 pushd "${TMP}" |
| 28 git clone https://skia.googlesource.com/skia | 24 git clone https://skia.googlesource.com/skia |
| 29 cd skia | 25 cd skia |
| 30 git fetch | 26 git fetch |
| 31 if [ -z "${FLAGS_skia_rev}" ]; then | 27 if [ -z "${FLAGS_skia_rev}" ]; then |
| 32 # Retrieve last known good revision. | 28 # Retrieve last known good revision. |
| 33 MY_DIR="$(gbash::get_absolute_caller_dir)" | 29 MY_DIR="$(gbash::get_absolute_caller_dir)" |
| 34 FLAGS_skia_rev="$(${MY_DIR}/get_skia_lkgr.sh)" | 30 FLAGS_skia_rev="$(${MY_DIR}/get_skia_lkgr.sh)" |
| 35 fi | 31 fi |
| 36 git checkout --detach "${FLAGS_skia_rev}" | 32 git checkout --detach "${FLAGS_skia_rev}" |
| 37 | 33 |
| 38 # Rsync to google3 location. | 34 # Rsync to google3 location. |
| 39 popd | 35 popd |
| 40 # Use multichange client in case there are too many files for nomultichange. htt
p://b/7292343 | 36 # Use multichange client in case there are too many files for nomultichange. htt
p://b/7292343 |
| 41 g4 client --set_option multichange | 37 g4 client --set_option multichange |
| 42 # Use allwrite to simplify opening the correct files after rsync. | 38 # Use allwrite to simplify opening the correct files after rsync. |
| 43 g4 client --set_option allwrite | 39 g4 client --set_option allwrite |
| 44 # Filter directories added to CitC. | 40 # Filter directories added to CitC. |
| 45 rsync -avzJ \ | 41 rsync -avzJ \ |
| 46 --delete \ | 42 --delete \ |
| 47 --delete-excluded \ | 43 --delete-excluded \ |
| 48 --include=/bench \ | 44 --include=/bench \ |
| 49 --include=/dm \ | 45 --include=/dm \ |
| 50 --include=/gm \ | 46 --include=/gm \ |
| 51 --include=/include \ | 47 --include=/include \ |
| 48 --include=/resources \ |
| 52 --exclude=/src/animator \ | 49 --exclude=/src/animator \ |
| 53 --include=/src \ | 50 --include=/src \ |
| 54 --include=/tests \ | 51 --include=/tests \ |
| 55 --include=/third_party \ | 52 --include=/third_party \ |
| 56 --include=/tools \ | 53 --include=/tools \ |
| 57 --include=/.git \ | 54 --include=/.git \ |
| 58 '--exclude=/*/' \ | 55 '--exclude=/*/' \ |
| 59 --include=/third_party/etc1 \ | 56 --include=/third_party/etc1 \ |
| 60 --include=/third_party/ktx \ | 57 --include=/third_party/ktx \ |
| 61 --include=/third_party/libwebp \ | 58 --include=/third_party/libwebp \ |
| (...skipping 29 matching lines...) Expand all Loading... |
| 91 # will always change them to Unix line endings. | 88 # will always change them to Unix line endings. |
| 92 git update-index --skip-worktree make.bat | 89 git update-index --skip-worktree make.bat |
| 93 git update-index --skip-worktree make.py | 90 git update-index --skip-worktree make.py |
| 94 | 91 |
| 95 # Tell git to ignore files left out of the rsync (i.e. "deleted" files). | 92 # Tell git to ignore files left out of the rsync (i.e. "deleted" files). |
| 96 git status --porcelain | \ | 93 git status --porcelain | \ |
| 97 grep -e "^ D" | \ | 94 grep -e "^ D" | \ |
| 98 cut -c 4- | \ | 95 cut -c 4- | \ |
| 99 xargs git update-index --skip-worktree | 96 xargs git update-index --skip-worktree |
| 100 | 97 |
| OLD | NEW |