Stefan Beller <sbeller@xxxxxxxxxx> writes: > Currently when git-fetch is asked to recurse into submodules, it dispatches > a plain "git-fetch -C <submodule-dir>" (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 <sbeller@xxxxxxxxxx> > --- > > 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.