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

Unable to fetch commit when using --depth 1 mode #2887

Open
32h3basfl2 opened this issue Jan 22, 2024 · 0 comments
Open

Unable to fetch commit when using --depth 1 mode #2887

32h3basfl2 opened this issue Jan 22, 2024 · 0 comments

Comments

@32h3basfl2
Copy link

Problem Statement

Whenever attempt to fetch commit that are neither tagged nor head of branch, the following error comes out.

error: Server does not allow request for unadvertised object <hash_number>
Fetched in submodule path '<path_to_submodule>', but it did not contain <hash_number>. Direct fetching of that commit failed.

Step to Reproduce

  1. git clone --depth 1 <any_repo_with_submodule_with_hash_neither_head_of_branch_nor_tagged>
  2. cd <repo_name> && git submodule update --init

Attempted solution

With GIT_TRACE_PACKET=1 GIT_TRACE=2 git submodule update --init --depth 1, we can trace the packet:
On GitLab Web, you can find allow-reachable-sha1-in-want:

HEAD\0multi_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed allow-tip-sha1-in-want allow-reachable-sha1-in-want no-done symref=HEAD:refs/heads/master filter object-format=sha1 agent=git/2.42.0

But this is not on my case (missing allow-tip-sha1-in-want and allow-reachable-sha1-in-want ):

HEAD\0multi_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed no-done symref=HEAD:refs/heads/master object-format=sha1 agent=git/2.42.0

On Gitlab Omnibus, it is configurable by setting in /etc/gitlab/gitlab.rb but that file not exist in our Docker, nor relevant variable (uploadpack, allowReachableSHA1InWant) exist at all (correct me if I oversight it).

Is there a way to turn that option on by default in our case?

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

No branches or pull requests

1 participant