Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: tools/git_clone_to_google3.sh

Issue 1291343006: Fix a few bugs in the google3 sync scripts. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/sync_google3.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 source gbash.sh || exit
14 DEFINE_string skia_rev "" "Git hash of Skia revision to clone, default LKGR." 14 DEFINE_string skia_rev "" "Git hash of Skia revision to clone, default LKGR."
15 gbash::init_google "$@"
15 16
16 set -x -e 17 set -x -e
17 18
18 # To run this script after making edits, run: 19 # To run this script after making edits, run:
19 # g4 revert -k git_clone_to_google3.sh 20 # g4 revert -k git_clone_to_google3.sh
20 # To get the file back into your CL, run: 21 # To get the file back into your CL, run:
21 # g4 edit git_clone_to_google3.sh 22 # g4 edit git_clone_to_google3.sh
22 #g4 opened | grep -q "//depot" && gbash::die "Must run in a clean client." 23 #g4 opened | grep -q "//depot" && gbash::die "Must run in a clean client."
23 24
24 # Checkout LKGR of Skia in a temp location. 25 # Checkout LKGR of Skia in a temp location.
(...skipping 16 matching lines...) Expand all
41 # Use allwrite to simplify opening the correct files after rsync. 42 # Use allwrite to simplify opening the correct files after rsync.
42 g4 client --set_option allwrite 43 g4 client --set_option allwrite
43 # Filter directories added to CitC. 44 # Filter directories added to CitC.
44 rsync -avzJ \ 45 rsync -avzJ \
45 --delete \ 46 --delete \
46 --delete-excluded \ 47 --delete-excluded \
47 --include=/bench \ 48 --include=/bench \
48 --include=/dm \ 49 --include=/dm \
49 --include=/gm \ 50 --include=/gm \
50 --include=/include \ 51 --include=/include \
52 --exclude=/src/animator \
51 --include=/src \ 53 --include=/src \
52 --exclude=/src/animator \
53 --include=/tests \ 54 --include=/tests \
54 --include=/third_party \ 55 --include=/third_party \
55 --include=/tools \ 56 --include=/tools \
56 --include=/.git \ 57 --include=/.git \
57 '--exclude=/*/' \ 58 '--exclude=/*/' \
58 --include=/third_party/etc1 \ 59 --include=/third_party/etc1 \
59 --include=/third_party/ktx \ 60 --include=/third_party/ktx \
60 --include=/third_party/libwebp \ 61 --include=/third_party/libwebp \
61 '--exclude=/third_party/*/' \ 62 '--exclude=/third_party/*/' \
62 "${TMP}/skia/" \ 63 "${TMP}/skia/" \
(...skipping 10 matching lines...) Expand all
73 -o -name .gitignore \ 74 -o -name .gitignore \
74 \) \ 75 \) \
75 -execdir g4 revert -k \{\} \; 76 -execdir g4 revert -k \{\} \;
76 77
77 # Tell Git to ignore README.google and BUILD. 78 # Tell Git to ignore README.google and BUILD.
78 echo README.google >> .git/info/exclude 79 echo README.google >> .git/info/exclude
79 echo BUILD >> .git/info/exclude 80 echo BUILD >> .git/info/exclude
80 g4 revert README.google 81 g4 revert README.google
81 g4 revert BUILD 82 g4 revert BUILD
82 83
83 # Use google3 version of OWNERS, README.google, and BUILD. 84 # Use google3 version of OWNERS.
84 find . \ 85 find . \
85 \( -name OWNERS -o -name README.google -o -name BUILD \) \ 86 -name OWNERS \
86 -exec git update-index --skip-worktree \{\} \; \ 87 -exec git update-index --skip-worktree \{\} \; \
87 -execdir g4 revert \{\} \; 88 -execdir g4 revert \{\} \;
88 89
90 # Tell git to ignore these files that have Windows line endings, because Piper
91 # will always change them to Unix line endings.
92 git update-index --skip-worktree make.bat
93 git update-index --skip-worktree make.py
94
89 # Tell git to ignore files left out of the rsync (i.e. "deleted" files). 95 # Tell git to ignore files left out of the rsync (i.e. "deleted" files).
90 git status --porcelain | \ 96 git status --porcelain | \
91 grep -e "^ D" | \ 97 grep -e "^ D" | \
92 cut -c 4- | \ 98 cut -c 4- | \
93 xargs git update-index --skip-worktree 99 xargs git update-index --skip-worktree
94 100
OLDNEW
« no previous file with comments | « no previous file | tools/sync_google3.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698