git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jens Lehmann <Jens.Lehmann@web.de>, Heiko Voigt <hvoigt@hvoigt.net>
Cc: git@vger.kernel.org, Fredrik Gustafsson <iveqy@iveqy.com>
Subject: Re: [PATCH] [submodule] Add depth to submodule update
Date: Mon, 24 Jun 2013 22:07:55 -0700	[thread overview]
Message-ID: <7vtxkm4w2c.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20130624224925.GC32270@paksenarrion.iveqy.com> (Fredrik Gustafsson's message of "Tue, 25 Jun 2013 00:49:25 +0200")

Summoning area experts ;-)

Thanks.

Fredrik Gustafsson <iveqy@iveqy.com> writes:

> Used only when a clone is initialized. This is useful when the submodule(s)
> are huge and you're not really interested in anything but the latest commit.
>
> Signed-off-by: Fredrik Gustafsson <iveqy@iveqy.com>
> ---
>  git-submodule.sh | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/git-submodule.sh b/git-submodule.sh
> index 79bfaac..b102fa8 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -211,12 +211,18 @@ module_clone()
>  	name=$2
>  	url=$3
>  	reference="$4"
> +	depth=$5
>  	quiet=
>  	if test -n "$GIT_QUIET"
>  	then
>  		quiet=-q
>  	fi
>
> +	if test -n "$depth"
> +	then
> +		depth="--depth=$depth"
> +	fi
> +
>  	gitdir=
>  	gitdir_base=
>  	base_name=$(dirname "$name")
> @@ -233,7 +239,7 @@ module_clone()
>  		mkdir -p "$gitdir_base"
>  		(
>  			clear_local_git_env
> -			git clone $quiet -n ${reference:+"$reference"} \
> +			git clone $quiet $depth -n ${reference:+"$reference"} \
>  				--separate-git-dir "$gitdir" "$url" "$sm_path"
>  		) ||
>  		die "$(eval_gettext "Clone of '\$url' into submodule path '\$sm_path' failed")"
> @@ -676,6 +682,9 @@ cmd_update()
>  		--checkout)
>  			update="checkout"
>  			;;
> +		--depth)
> +			depth=$2
> +			;;
>  		--)
>  			shift
>  			break
> @@ -735,7 +744,7 @@ Maybe you want to use 'update --init'?")"
>
>  		if ! test -d "$sm_path"/.git -o -f "$sm_path"/.git
>  		then
> -			module_clone "$sm_path" "$name" "$url" "$reference" || exit
> +			module_clone "$sm_path" "$name" "$url" "$reference" "$depth" || exit
>  			cloned_modules="$cloned_modules;$name"
>  			subsha1=
>  		else
> --
> 1.8.0

  reply	other threads:[~2013-06-25  5:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-23  8:04 [RFC] [submodule] Add depth to submodule update Fredrik Gustafsson
2013-06-24 22:49 ` [PATCH] " Fredrik Gustafsson
2013-06-25  5:07   ` Junio C Hamano [this message]
2013-06-25 22:11   ` Heiko Voigt
2013-06-26 16:02     ` Fredrik Gustafsson
2013-06-26 21:03       ` Junio C Hamano
2013-06-27 14:54         ` Jens Lehmann
2013-06-28  6:50           ` Heiko Voigt
2013-06-28 18:44             ` Junio C Hamano
2013-06-28 20:54               ` Jens Lehmann
2013-06-28 22:51                 ` Junio C Hamano
2013-06-28 23:07                   ` Fredrik Gustafsson
2013-06-30 19:17                     ` Junio C Hamano
2013-06-26 16:16     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vtxkm4w2c.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=hvoigt@hvoigt.net \
    --cc=iveqy@iveqy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).