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

Unified Diff: git-crup

Issue 12279006: Add --sync option, to only sync submodules. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git-crsync ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git-crup
diff --git a/git-crup b/git-crup
index d07a4283d54b6429415d7656a390bb4a33158b57..155afda63c6629f86336d0076851b00ed1bb4d53 100755
--- a/git-crup
+++ b/git-crup
@@ -45,16 +45,18 @@ fi
usage() {
cat <<EOF
-Usage: git-crup [-n|--dry-run] [--fetch] [-j|--jobs [jobs]]
+Usage: git-crup [-n|--dry-run] [--fetch|--sync] [-j|--jobs [jobs]]
[--no-hooks] [<args to git-pull or git-fetch>]
EOF
}
serial_update() {
( cd "$1"
- $GIT_EXE $pull $pull_args -q origin | sed "s/^/[$1] /g"
- if [ $? -ne 0 ]; then
- return $?
+ if test -n "$toplevel_cmd"; then
+ $toplevel_cmd | sed "s/^/[$1] /g"
+ if [ $? -ne 0 ]; then
+ return $?
+ fi
fi
$GIT_EXE submodule --quiet sync
$GIT_EXE ls-files -s | grep ^160000 | awk '{print $4}' |
@@ -93,6 +95,9 @@ while test $# -ne 0; do
--fetch)
pull=fetch
;;
+ --sync)
+ pull=
+ ;;
--no-hooks|--nohooks)
hooks=no
;;
@@ -124,11 +129,17 @@ else
xargs_parallel=no
fi
+if test -n "$pull"; then
+ toplevel_cmd="$GIT_EXE $pull $pull_args -q origin"
+else
+ toplevel_cmd=
+fi
+
set -o pipefail
if test "$xargs_parallel" = "yes"; then
( ls -d */.git | sed 's/\/\.git$//' |
xargs $max_lines $replace_arg -P "$j" \
- "$crup_runner" replace_arg $GIT_EXE $pull $pull_args -q origin |
+ "$crup_runner" replace_arg $toplevel_cmd |
xargs $max_lines -P "$j" "$crup_runner" )
else
ls -d */.git |
« no previous file with comments | « git-crsync ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698