libgit2 / libgit2/libgit2sharp
How to fetch blobs from remote or alternate repositories
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 3.5k
- Fork
- 925
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo su .NET 8 e LibGit2Sharp 0.31.0 la configurazione con repository bare, alternates e blobless fetch descritta nell’issue. Leggi la documentazione di Git sui partial-clone indicata e determina come recuperare i blob mancanti dal remote o dagli alternates; il lavoro è completo quando l’errore segnalato relativo a un oggetto mancante viene gestito tramite il comportamento supportato dalla libreria.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp, git
- Ambito
- devtools
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100