skia2/tools/git_clone_to_google3.sh

101 lines
2.7 KiB
Bash
Raw Normal View History

#!/bin/bash
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Crude script to clone the git skia repo into the current directory, which
# must be a CitC client.
#
# Usage:
# ./tools/git_clone_to_google3.sh
source gbash.sh || exit
DEFINE_string skia_rev "" "Git hash of Skia revision to clone, default LKGR."
Reland of Fix a few bugs in the google3 sync scripts. (patchset #1 id:1 of https://codereview.chromium.org/1295213002/ ) Reason for revert: Retry. Original issue's description: > Revert of Fix a few bugs in the google3 sync scripts. (patchset #1 id:1 of https://codereview.chromium.org/1291343006/ ) > > Reason for revert: > MacMini buildbots were unable to apply the patch. > fatal: Could not parse object '18af0a0080cc2b2b3464292d35a0886cdade551f'. > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release/builds/1580 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Debug/builds/1474 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Release/builds/1566 > http://build.chromium.org/p/client.skia/builders/Perf-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Release/builds/1480 > http://build.chromium.org/p/client.skia/builders/Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release/builds/1456 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/1364 > > > Original issue's description: > > Fix a few bugs in the google3 sync scripts. > > > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/18af0a0080cc2b2b3464292d35a0886cdade551f > > TBR=mtklein@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/e349d6b92574c1b0acdb4ba1ed8ff905ea830131 TBR=mtklein@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1284093003
2015-08-18 13:25:14 +00:00
gbash::init_google "$@"
set -x -e
# To run this script after making edits, run:
# g4 revert -k git_clone_to_google3.sh
# To get the file back into your CL, run:
# g4 edit git_clone_to_google3.sh
#g4 opened | grep -q "//depot" && gbash::die "Must run in a clean client."
# Checkout LKGR of Skia in a temp location.
TMP=$(gbash::make_temp_dir)
pushd "${TMP}"
git clone https://skia.googlesource.com/skia
cd skia
git fetch
if [ -z "${FLAGS_skia_rev}" ]; then
# Retrieve last known good revision.
MY_DIR="$(gbash::get_absolute_caller_dir)"
FLAGS_skia_rev="$(${MY_DIR}/get_skia_lkgr.sh)"
fi
git checkout --detach "${FLAGS_skia_rev}"
# Rsync to google3 location.
popd
# Use multichange client in case there are too many files for nomultichange. http://b/7292343
g4 client --set_option multichange
# Use allwrite to simplify opening the correct files after rsync.
g4 client --set_option allwrite
# Filter directories added to CitC.
rsync -avzJ \
--delete \
--delete-excluded \
--include=/bench \
--include=/dm \
--include=/gm \
--include=/include \
--exclude=/src/animator \
Reland of Fix a few bugs in the google3 sync scripts. (patchset #1 id:1 of https://codereview.chromium.org/1295213002/ ) Reason for revert: Retry. Original issue's description: > Revert of Fix a few bugs in the google3 sync scripts. (patchset #1 id:1 of https://codereview.chromium.org/1291343006/ ) > > Reason for revert: > MacMini buildbots were unable to apply the patch. > fatal: Could not parse object '18af0a0080cc2b2b3464292d35a0886cdade551f'. > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release/builds/1580 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Debug/builds/1474 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Release/builds/1566 > http://build.chromium.org/p/client.skia/builders/Perf-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Release/builds/1480 > http://build.chromium.org/p/client.skia/builders/Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release/builds/1456 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/1364 > > > Original issue's description: > > Fix a few bugs in the google3 sync scripts. > > > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/18af0a0080cc2b2b3464292d35a0886cdade551f > > TBR=mtklein@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/e349d6b92574c1b0acdb4ba1ed8ff905ea830131 TBR=mtklein@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1284093003
2015-08-18 13:25:14 +00:00
--include=/src \
--include=/tests \
--include=/third_party \
--include=/tools \
--include=/.git \
'--exclude=/*/' \
--include=/third_party/etc1 \
--include=/third_party/ktx \
--include=/third_party/libwebp \
'--exclude=/third_party/*/' \
"${TMP}/skia/" \
"./"
# Open added/changed files for add/edit.
g4 reopen
# Revert files that are equivalent to the checked in version.
g4 revert -a
# Tell CitC to ignore .git and .gitignore.
find . \
\( -name .git \
-o -name .gitignore \
\) \
-execdir g4 revert -k \{\} \;
# Tell Git to ignore README.google and BUILD.
echo README.google >> .git/info/exclude
echo BUILD >> .git/info/exclude
g4 revert README.google
g4 revert BUILD
Reland of Fix a few bugs in the google3 sync scripts. (patchset #1 id:1 of https://codereview.chromium.org/1295213002/ ) Reason for revert: Retry. Original issue's description: > Revert of Fix a few bugs in the google3 sync scripts. (patchset #1 id:1 of https://codereview.chromium.org/1291343006/ ) > > Reason for revert: > MacMini buildbots were unable to apply the patch. > fatal: Could not parse object '18af0a0080cc2b2b3464292d35a0886cdade551f'. > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release/builds/1580 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Debug/builds/1474 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Release/builds/1566 > http://build.chromium.org/p/client.skia/builders/Perf-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Release/builds/1480 > http://build.chromium.org/p/client.skia/builders/Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release/builds/1456 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/1364 > > > Original issue's description: > > Fix a few bugs in the google3 sync scripts. > > > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/18af0a0080cc2b2b3464292d35a0886cdade551f > > TBR=mtklein@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/e349d6b92574c1b0acdb4ba1ed8ff905ea830131 TBR=mtklein@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1284093003
2015-08-18 13:25:14 +00:00
# Use google3 version of OWNERS.
find . \
Reland of Fix a few bugs in the google3 sync scripts. (patchset #1 id:1 of https://codereview.chromium.org/1295213002/ ) Reason for revert: Retry. Original issue's description: > Revert of Fix a few bugs in the google3 sync scripts. (patchset #1 id:1 of https://codereview.chromium.org/1291343006/ ) > > Reason for revert: > MacMini buildbots were unable to apply the patch. > fatal: Could not parse object '18af0a0080cc2b2b3464292d35a0886cdade551f'. > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release/builds/1580 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Debug/builds/1474 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Release/builds/1566 > http://build.chromium.org/p/client.skia/builders/Perf-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Release/builds/1480 > http://build.chromium.org/p/client.skia/builders/Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release/builds/1456 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/1364 > > > Original issue's description: > > Fix a few bugs in the google3 sync scripts. > > > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/18af0a0080cc2b2b3464292d35a0886cdade551f > > TBR=mtklein@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/e349d6b92574c1b0acdb4ba1ed8ff905ea830131 TBR=mtklein@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1284093003
2015-08-18 13:25:14 +00:00
-name OWNERS \
-exec git update-index --skip-worktree \{\} \; \
-execdir g4 revert \{\} \;
Reland of Fix a few bugs in the google3 sync scripts. (patchset #1 id:1 of https://codereview.chromium.org/1295213002/ ) Reason for revert: Retry. Original issue's description: > Revert of Fix a few bugs in the google3 sync scripts. (patchset #1 id:1 of https://codereview.chromium.org/1291343006/ ) > > Reason for revert: > MacMini buildbots were unable to apply the patch. > fatal: Could not parse object '18af0a0080cc2b2b3464292d35a0886cdade551f'. > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release/builds/1580 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Debug/builds/1474 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Release/builds/1566 > http://build.chromium.org/p/client.skia/builders/Perf-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Release/builds/1480 > http://build.chromium.org/p/client.skia/builders/Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release/builds/1456 > http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/1364 > > > Original issue's description: > > Fix a few bugs in the google3 sync scripts. > > > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/18af0a0080cc2b2b3464292d35a0886cdade551f > > TBR=mtklein@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/e349d6b92574c1b0acdb4ba1ed8ff905ea830131 TBR=mtklein@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1284093003
2015-08-18 13:25:14 +00:00
# Tell git to ignore these files that have Windows line endings, because Piper
# will always change them to Unix line endings.
git update-index --skip-worktree make.bat
git update-index --skip-worktree make.py
# Tell git to ignore files left out of the rsync (i.e. "deleted" files).
git status --porcelain | \
grep -e "^ D" | \
cut -c 4- | \
xargs git update-index --skip-worktree