From: Jonathan Nieder <jrnieder@gmail.com>
To: Stefan Beller <sbeller@google.com>
Cc: Junio C Hamano <gitster@pobox.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH] submodule: use cheaper check for submodule pushes
Date: Thu, 13 Jul 2017 13:48:54 -0700 [thread overview]
Message-ID: <20170713204854.GA158114@aiede.mtv.corp.google.com> (raw)
In-Reply-To: <CAGZ79kYtRbHvfC6d=+eEXCceJam4wwo9XqvY752c_pg6kq90DA@mail.gmail.com>
Hi,
Stefan Beller wrote:
> Yes we are safe, because the function itself only spawns a child process
> (not using any of the objects).
>
> It's only caller push_unpushed_submodules also doesn't rely on objects
> loaded after calling push_submodule.
>
> The caller of push_unpushed_submodules (transport.c, transport_push)
> also doesn't need submodule objects loaded.
Thanks for looking into it. This is what the commit message should
say to help reviewers or people trying to understand it later. The
footnotes don't help and are distracting, except that it makes sense
to point out the original GSoC patch to say the alternate submodule
odb wasn't needed even then.
E.g.:
Subject: push: do not add submodule odb as an alternate when recursing on demand
"git push --recurse-submodules=on-demand" adds each submodule as an
alternate with add_submodule_odb before checking whether the
submodule has anything to push and pushing it if so.
However, it never accesses any objects from the submodule. In the
parent process it uses the submodule's ref database to see if there
is anything to push. The actual push (which does rely on objects)
occurs in a child process.
The same was try when this call was originally added in
v1.7.11-rc0~111^2 (push: teach --recurse-submodules the on-demand
option, 2012-03-29). Most likely it was added by analogy with
fetch --recurse-submodules=on-demand, which did use the submodule's
object database.
Use is_submodule_populated_gently instead, which is simpler and
cheaper.
[...]
> On Thu, Jul 13, 2017 at 11:37 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> My hunch (and hope) is that we are probably safe, but that is a lot
>> weaker than "yes this is a good change we want to apply".
>
> Given the above (I went through the code), all I can do is repeating
> "yes this is a good change we want to apply".
With such a commit message change, this seems like a reasonable change
in principle (though I haven't looked carefully to verify it).
My one doubt is the is_submodule_populated_gently. Why are we using
that instead of simpler is_submodule_populated? The names and API
comments don't explain.
Thanks for your patient explanations,
Jonathan
next prev parent reply other threads:[~2017-07-13 20:49 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 [this message]
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
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=20170713204854.GA158114@aiede.mtv.corp.google.com \
--to=jrnieder@gmail.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.
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).