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>, Stefan Beller <sbeller@google.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
	Dave Borowitz <dborowitz@google.com>
Subject: Re: [PATCH] submodule: Fetch the direct sha1 first
Date: Mon, 22 Feb 2016 20:22:04 +0100	[thread overview]
Message-ID: <56CB5FDC.5050409@web.de> (raw)
In-Reply-To: <xmqqvb5k9r5g.fsf@gitster.mtv.corp.google.com>

Am 20.02.2016 um 01:11 schrieb Junio C Hamano:
> Stefan Beller <sbeller@google.com> writes:
>
>> On Fri, Feb 19, 2016 at 2:29 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Stefan Beller <sbeller@google.com> writes:
>>>
>>>> Doing a 'git fetch' only and not the fetch for the specific sha1 would be
>>>> incorrect?
>>>
>>> I thought that was what you are attempting to address.
>>
>> Yep. In an ideal world I would imagine it would look like
>>
>>      if $sha1 doesn't exist:
>>          fetch $sha1
>>          if server did not support fetching direct sha1:
>>              fallback to fetch <no args>
>
> It should look more like this:
>
> 	if $sha1's history and objects are incomplete:
> 		fetch ;# normally just like we have done before
>                  if $sha1's history and objects are still incomplete:
> 			fetch $sha1

That makes lots of sense, doesn't break existing workflows and
enables the use case Stefan described. And if people want to skip
the first fetch later we could still add a config option to do so.

> as existing users already expect that commits and objects that are
> reachable from tips of refs configured to be fetched in the
> submodule via its configured refspecs are available after this part
> of the code runs, regardless of this "Gerrit reviews may not have
> arrived to branches yet" issue.  The first "normal" fetch ensures
> that the expectation is met.

Not sure if that has come up so far, but I believe we should not
only do that for the submodule command but also for a regular
fetch when it is configured to fetch submodule commits too (which
it is by default unless configured otherwise). Otherwise we'll
lose the plane-safety fetch normally provides in case of these
unconnected submodule sha1s, which would then again break users
expectations.

And if we see demand for only fetching the sha1s without any
extra history in the future (e.g. to minimize the amount of data
to be fetched by a CI server), we could add a new value ("by-sha1"
or such) for both the --recurse-submodules option of fetch and
pull and the submodule.<name>.fetchRecurseSubmodules config
setting. Then both a git submodule update and fetch would attempt
to just fetch the sha1(s) needed without any fetching any extra
history.

  reply	other threads:[~2016-02-22 19:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19 18:57 [PATCH] submodule: Fetch the direct sha1 first Stefan Beller
2016-02-19 21:13 ` Junio C Hamano
2016-02-19 22:10   ` Stefan Beller
2016-02-19 22:29     ` Junio C Hamano
2016-02-19 23:40       ` Stefan Beller
2016-02-20  0:11         ` Junio C Hamano
2016-02-22 19:22           ` Jens Lehmann [this message]
2016-02-20 10:52   ` Jacob Keller

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=56CB5FDC.5050409@web.de \
    --to=jens.lehmann@web.de \
    --cc=dborowitz@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sbeller@google.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).