libgit2 / libgit2/pygit2

Problem with implement the equiv of git pull

Aperta
#613 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

documentation
Lingua principale
Python
Stelle
1.7k
Fork
408
Merge medio
2g 57m
PR unite (30g)
7

Descrizione

I am working my way through an implementation of git pull.

It seems that I need to do a Remote.fetch() call followed by a merge.

Problem (1): what is the robust way to generate the fetch_refspecs if the REmote.fetch_refspecs is empty? In other words do you have the APIs that I can duplciaste what push.default=simple causes git pull to do?

Problem (2): I have the objects fetched back I do not know the API to call to merge the remote changed into the local. I tried calling repo.merge() with the ID of the lastest commit from the remote.
But that only lead to modified files in the index. What is the correct API code to make this work?

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia leggendo le API Remote.fetch, Remote.fetch_refspecs e Repository.merge menzionate nella issue, insieme al modo in cui git pull usa push.default=simple. Determina la sequenza di fetch e merge supportata, quindi conferma che le modifiche recuperate dal repository remoto vengano unite nel repository locale invece di lasciare soltanto modifiche nell'indice.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
git, python
Ambito
devtools
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.