[PATCH 10/15] git-checkout: pass --submodules option to git-read-tree

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: skimo
Date: Sunday, May 20, 2007 - 11:04 am

From: Sven Verdoolaege <skimo@kotnet.org>

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
 git-checkout.sh |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/git-checkout.sh b/git-checkout.sh
index 6b6facf..162cef4 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-USAGE='[-q] [-f] [-b <new_branch>] [-m] [<branch>] [<paths>...]'
+USAGE='[-q] [-f] [--submodules] [--no-submodules] [-b <new_branch>] [-m] [<branch>] [<paths>...]'
 SUBDIRECTORY_OK=Sometimes
 . git-sh-setup
 require_work_tree
@@ -16,6 +16,7 @@ track=
 newbranch=
 newbranch_log=
 merge=
+submodules=
 quiet=
 v=-v
 LF='
@@ -46,6 +47,15 @@ while [ "$#" != "0" ]; do
 	-m)
 		merge=1
 		;;
+	--su|--sub|--subm|--submo|--submod|--submodu|--submodul|\
+	--submodule|--submodules)
+		submodules="--submodules"
+		;;
+	--no-su|--no-sub|--no-subm|--no-submo|--no-submod|\
+	--no-submodu|--no-submodul|\
+	--no-submodule|--no-submodules)
+		submodules="--no-submodules"
+		;;
 	"-q")
 		quiet=1
 		v=
@@ -199,10 +209,10 @@ fi
 
 if [ "$force" ]
 then
-    git-read-tree $v --reset -u $new
+    git-read-tree $v $submodules --reset -u $new
 else
     git-update-index --refresh >/dev/null
-    merge_error=$(git-read-tree -m -u --exclude-per-directory=.gitignore $old $new 2>&1) || (
+    merge_error=$(git-read-tree $submodules -m -u --exclude-per-directory=.gitignore $old $new 2>&1) || (
 	case "$merge" in
 	'')
 		echo >&2 "$merge_error"
@@ -212,7 +222,7 @@ else
 	# Match the index to the working tree, and do a three-way.
     	git diff-files --name-only | git update-index --remove --stdin &&
 	work=`git write-tree` &&
-	git read-tree $v --reset -u $new || exit
+	git read-tree $v $submodules --reset -u $new || exit
 
 	eval GITHEAD_$new='${new_name:-${branch:-$new}}' &&
 	eval GITHEAD_$work=local &&
@@ -223,7 +233,7 @@ else
 	# this is not a real merge before committing, but just carrying
 	# the working tree changes along.
 	unmerged=`git ls-files -u`
-	git read-tree $v --reset $new
+	git read-tree $v $submodules --reset $new
 	case "$unmerged" in
 	'')	;;
 	*)
-- 
1.5.2.rc3.815.g8fc2

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 01/15] Add dump-config, skimo, (Sun May 20, 11:04 am)
[PATCH 10/15] git-checkout: pass --submodules option to gi ..., skimo, (Sun May 20, 11:04 am)
Re: [PATCH 02/15] git-config: add --remote option for read ..., Frank Lichtenheld, (Sun May 20, 11:11 am)
Re: [RFC] Third round of support for cloning submodules, Junio C Hamano, (Sun May 20, 12:10 pm)
Re: [PATCH 02/15] git-config: add --remote option for read ..., Sven Verdoolaege, (Sun May 20, 12:44 pm)
Re: [RFC] Third round of support for cloning submodules, Sven Verdoolaege, (Sun May 20, 12:59 pm)
Re: [RFC] Third round of support for cloning submodules, Sven Verdoolaege, (Sun May 20, 2:09 pm)
Re: [RFC] Third round of support for cloning submodules, Martin Waitz, (Sun May 20, 2:40 pm)
Re: [RFC] Third round of support for cloning submodules, Sven Verdoolaege, (Sun May 20, 2:47 pm)
Re: [PATCH 06/15] git-read-tree: take --submodules option, Sven Verdoolaege, (Sun May 20, 2:50 pm)
Re: [PATCH 09/15] entry.c: optionally checkout submodules, Sven Verdoolaege, (Sun May 20, 2:51 pm)
Re: [PATCH 02/15] git-config: add --remote option for read ..., Frank Lichtenheld, (Sun May 20, 3:03 pm)
Re: [RFC] Third round of support for cloning submodules, Martin Waitz, (Sun May 20, 3:14 pm)
Re: [RFC] Third round of support for cloning submodules, Martin Waitz, (Sun May 20, 3:52 pm)
Re: [RFC] Third round of support for cloning submodules, Martin Waitz, (Sun May 20, 3:55 pm)
Re: [RFC] Third round of support for cloning submodules, Martin Waitz, (Sun May 20, 4:12 pm)
Re: [RFC] Third round of support for cloning submodules, Martin Waitz, (Sun May 20, 4:36 pm)
Re: [RFC] Third round of support for cloning submodules, Steven Grimm, (Sun May 20, 5:39 pm)
Re: [RFC] Third round of support for cloning submodules, Sven Verdoolaege, (Mon May 21, 1:54 am)
Re: [RFC] Third round of support for cloning submodules, Sven Verdoolaege, (Mon May 21, 2:57 am)
Re: [RFC] Third round of support for cloning submodules, Sven Verdoolaege, (Mon May 21, 3:01 am)
Re: [RFC] Third round of support for cloning submodules, Martin Waitz, (Mon May 21, 3:07 am)
Re: [RFC] Third round of support for cloning submodules, Sven Verdoolaege, (Mon May 21, 3:14 am)
Re: [RFC] Third round of support for cloning submodules, Josef Weidendorfer, (Mon May 21, 3:44 am)
Re: [RFC] Third round of support for cloning submodules, Martin Waitz, (Mon May 21, 4:34 am)
Re: [RFC] Third round of support for cloning submodules, Martin Waitz, (Mon May 21, 4:41 am)
Re: [RFC] Third round of support for cloning submodules, Sven Verdoolaege, (Mon May 21, 5:19 am)
Re: [PATCH 09/15] entry.c: optionally checkout submodules, Sven Verdoolaege, (Thu May 24, 6:29 am)
Re: [RFC] Third round of support for cloning submodules, Martin Waitz, (Thu May 24, 8:56 am)