git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: "git\@vger.kernel.org" <git@vger.kernel.org>,
	Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH] push: do not add submodule odb as an alternate when recursing on demand
Date: Tue, 15 Aug 2017 17:11:35 -0700	[thread overview]
Message-ID: <xmqqd17wpe14.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAGZ79kag+U94tzJ14mB4VZjSZ2MtUJ4vu4MXKLKkpkLw=2K_NA@mail.gmail.com> (Stefan Beller's message of "Tue, 15 Aug 2017 16:31:05 -0700")

Stefan Beller <sbeller@google.com> writes:

>> Is "is it populated" a good thing to check here, though?  IIRC,
>> add-submodule-odb allows you to add the object database of an
>> inactivated submodule, so this seems to change the behaviour.  I do
>> not know if the behaviour change is a good thing (i.e. bugfix) or
>> not (i.e. regression) offhand, though.
>
> Good point, we should be able to push non-populated, even inactive(?)
> submodules. For that we strictly need add_submodule_odb here
> (or the repo object of the submodule, eventually).
>
> So let's retract this patch for now.

Not so fast.  

I am not convinced "push --recursive" should touch a submodule that
was once cloned from the upstream and then deactivated, so using
add-submodule-odb to decide if the push should go through may be a
bug that we may want to fix, in which case the diff of the patch in
question may be good as-is.  We need to sell it as a bugfix to the
users, who may complain about behaviour change (if there is one).

On the other hand, even if it were desirable for such a deactivated
submodule to be pushed, as your log message explained, there is no
reason to contaminate the in-core object hash by calling the
add-submodule-odb helper, when the only thing we care about is "do
we have the refs and object store for this submodule? we do not care
if it is activated or not".  Perhaps there is a more appropriate
helper in submodule.c that answers that question that we should be
using instead of add-submodule-odb, and if there is not yet such a
helper, perhaps this indicates that we need to add such a helper,
which essentially is the early half of what add-submodule-odb does,
i.e. ask git_path_submodule() for the object store and check if that
directory exists.

Thanks.

  reply	other threads:[~2017-08-16  0:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12 23:45 [PATCH] submodule: use cheaper check for submodule pushes Stefan Beller
2017-07-13  0:01 ` Jonathan Nieder
2017-07-13  0:09   ` Stefan Beller
2017-07-13  0:53   ` Junio C Hamano
2017-07-13  5:14     ` Stefan Beller
2017-07-13 18:37       ` Junio C Hamano
2017-07-13 19:39         ` Stefan Beller
2017-07-13 20:48           ` Jonathan Nieder
2017-07-13 20:54             ` Stefan Beller
2017-08-15 22:43               ` [PATCH] push: do not add submodule odb as an alternate when recursing on demand Stefan Beller
2017-08-15 23:10                 ` Jonathan Nieder
2017-08-15 23:14                 ` Jonathan Nieder
2017-08-15 23:27                   ` Stefan Beller
2017-08-15 23:23                 ` Junio C Hamano
2017-08-15 23:31                   ` Stefan Beller
2017-08-16  0:11                     ` Junio C Hamano [this message]
2017-08-16  1:05                       ` Stefan Beller
2017-08-16  2:08                         ` Jonathan Nieder
2017-08-16  5:52                           ` Stefan Beller
2017-08-16 16:35                         ` Heiko Voigt

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqd17wpe14.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).