From: Junio C Hamano Date: Sun, 09 Dec 2018 01:57:44 GMT Subject: Re: [PATCH] fetch: ensure submodule objects fetched Message-ID: In-Reply-To: <20181206212655.145586-1-sbeller@google.com> Stefan Beller writes: > Currently when git-fetch is asked to recurse into submodules, it dispatches > a plain "git-fetch -C " (with some submodule related options > such as prefix and recusing strategy, but) without any information of the > remote or the tip that should be fetched. > > But this default fetch is not sufficient, as a newly fetched commit in > the superproject could point to a commit in the submodule that is not > in the default refspec. This is common in workflows like Gerrit's. > When fetching a Gerrit change under review (from refs/changes/??), the > commits in that change likely point to submodule commits that have not > been merged to a branch yet. > > Fetch a submodule object by id if the object that the superproject > points to, cannot be found. For now this object is fetched from the > 'origin' remote as we defer getting the default remote to a later patch. > > A list of new submodule commits are already generated in certain > conditions (by check_for_new_submodule_commits()); this new feature > invokes that function in more situations. > > The submodule checks were done only when a ref in the superproject > changed, these checks were extended to also be performed when fetching > into FETCH_HEAD for completeness, and add a test for that too. > > Signed-off-by: Stefan Beller > --- > > Thanks Jonathan for the review! > So it looks like only the last patch needs some improvements, > which is why I'd only resend the last patch here. > Also note the test with interious superproject commits. Sorry, can't parse the last sentence. Anyway, will replace the last step with this. Thanks.