git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Fredrik Gustafsson <iveqy@iveqy.com>,
	Heiko Voigt <hvoigt@hvoigt.net>,
	git@vger.kernel.org
Subject: Re: [PATCH] [submodule] Add depth to submodule update
Date: Thu, 27 Jun 2013 16:54:45 +0200	[thread overview]
Message-ID: <51CC5235.6030908@web.de> (raw)
In-Reply-To: <7vli5wvb3n.fsf@alter.siamese.dyndns.org>

Am 26.06.2013 23:03, schrieb Junio C Hamano:
> Fredrik Gustafsson <iveqy@iveqy.com> writes:
> 
>> On Wed, Jun 26, 2013 at 12:11:32AM +0200, Heiko Voigt wrote:
>>> On Tue, Jun 25, 2013 at 12:49:25AM +0200, Fredrik Gustafsson wrote:
>>>> 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>
>>>
>>> I this is a valid use case. But this option only makes sense when a
>>> submodule is newly cloned so I am not sure whether submodule update is
>>> the correct place. Let me think about this a little more. Since we do
>>> not have any extra command that initiates the clone this is probably the
>>> only place we can put this option. But at the moment it does not feel
>>> completely right.
>>>
>>> Apart from that the code looks good. If the user does a checkout of a
>>> revision that was not fetched submodule update will error out the same
>>> way as if someone forgot to push his submodule changes. So that should
>>> not be a problem.
>>
>> I agree and would love to say that I've a more beautiful solution, but
>> I haven't.
>>
>> The only other solution I can think about is to add a git
>> submodule clone that will do only clones of non-cloned submodules.
> 
> The "update" subcommand already has "--init" to do "init && update",
> and it would not complain if a given submodule is what you already
> have shown interest in, so in that sense, I do not think what the
> posted patch does is too bad---if it is already cloned, it just
> ignores the depth altogether and makes sure the repository is there.
> A separate "submodule clone" would only make it more cumbersome to
> use, I suspect.

Yup, I see no need for a new command either.

Me too thinks adding "--depth" to "update" makes sense (and I don't
think that this pretty generic name will become a problem later in
case someone wants to add a maximum recursion depth, as grep already
uses "--max-depth" for the same purpose).

But "--depth" should also be added to the "submodule add" command.
As an example we already have the "--reference" option, which is
passed to clone on add and update. Additionally that one supports
the form with and without '=', so I'd prefer the new update option
to basically re-use the same code the reference option uses. And
at least two tests, of course ;-)

  reply	other threads:[~2013-06-27 14:55 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
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 [this message]
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=51CC5235.6030908@web.de \
    --to=jens.lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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).