libgit2 / libgit2/libgit2sharp
How to fetch blobs from remote or alternate repositories
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C#
- Star
- 3.5k
- Fork
- 925
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
For CI processes we have repositories that are cloned with "--filter=blob:none".
Also we have a repository cache folder that we set via ".git/objects/info/alternates".
When we try to access the blob contend it fails, is there a way to download the blob from the remote repository?
For alternates objects I can probably just copy the objects over manually but I would prefer proper lib support.
What I'm looking for is something like https://git-scm.com/docs/partial-clone/2.49.0#_fetching_missing_objects
Manly ideas how to custom implement this or an integrated solution when using the lib.
Reproduction steps
Example repo setup:
git init $GITHUB_WORKSPACE/git --bare
git remote add origin git@github.com:${{ github.repository }}.git
echo "/git-cache/${{ github.repository }}.git/objects" >> ./objects/info/alternates
git fetch --no-tags --no-recurse-submodules --filter=blob:none origin ${{ env.DefaultBranch }}
Actual behavior
Depending on function: No valid git object identified by 'sha xxxxxx' exists in the repository.
Version of LibGit2Sharp (release number or SHA1)
0.31.0
Operating system(s) tested; .NET runtime tested
Win 11 / Debian | Net Core 8
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện trên .NET 8 và LibGit2Sharp 0.31.0 thiết lập bare repository, alternates và blobless fetch được mô tả trong issue. Đọc tài liệu Git về partial-clone được tham chiếu và xác định cách các blob bị thiếu phải được lấy từ remote hoặc alternates; hoàn thành có nghĩa là lỗi thiếu object được báo cáo được xử lý thông qua hành vi được thư viện hỗ trợ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp, git
- Lĩnh vực
- devtools
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100