libgit2 / libgit2/libgit2sharp
How to fetch blobs from remote or alternate repositories
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 3.5k
- Forks
- 925
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das im Issue beschriebene Setup aus Bare-Repository, alternates und blobless fetch auf .NET 8 und LibGit2Sharp 0.31.0 nachzustellen. Lies die referenzierte Dokumentation zu partiellen Git-Klonen und ermittle, wie fehlende Blobs aus dem Remote oder aus alternates abgerufen werden sollten; abgeschlossen ist die Aufgabe, wenn der gemeldete Fehler wegen eines fehlenden Objekts über unterstütztes Bibliotheksverhalten behandelt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp, git
- Bereich
- devtools
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100