Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added separate parameter for submodules fetch depth #392

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vvish
Copy link

@vvish vvish commented Nov 20, 2020

Using the same value of the fetch depth in the main repository and submodules can lead to a problem that cloned submodule will not contain commit referenced in the main repository. If the depth is not enough and there are commits in the submodule repository on top of the referenced one, the submodule update can fail with the following output:

/usr/bin/git submodule sync
/usr/bin/git -c protocol.version=2 submodule update --init --force --depth=1
Submodule '<some-submodule>' (https://<submodule>.git) registered for path '<submodule-path>'
Cloning into '/home/runner/work/<sobmodule-path>'...
Error: error: Server does not allow request for unadvertised object <some-sha>
Fetched in submodule path '<sobmodule-path>', but it did not contain <some-sha>. Direct fetching of that commit failed.
Error: The process '/usr/bin/git' failed with exit code 1

At the same time increasing general fetch depth will increase fetch timing for the main repository.
The proposal is to separate the parameters by introduction of the 'submodules-fetch-depth' parameter that will default to
fetch-depth value if not present.

@vvish vvish force-pushed the feat_submodules_depth branch from 9d0e7c9 to abd1df2 Compare November 22, 2020 00:22
@vvish vvish force-pushed the feat_submodules_depth branch from abd1df2 to 25e07a1 Compare November 22, 2020 00:36
@ixti
Copy link

ixti commented Jun 27, 2023

Is there any chance this will become a reality?

We need history of main repo, but not submodules. And without this feature checkout slow :((

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants