libgit2 / libgit2/libgit2sharp

Add branch querying/filtering feature

Aperta
#147 10 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

FeatReq
Lingua principale
C#
Stelle
3.5k
Fork
925
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The git-branch doc states

With --contains, shows only the branches that contain the named commit (in other
words, the branches whose tip commits are descendants of the named commit).

With --merged, only branches merged into the named commit (i.e. the branches whose
tip commits are reachable from the named commit) will be listed.

With --no-merged only branches not merged into the named commit will be listed.

If the <commit> argument is missing it defaults to HEAD (i.e. the tip of the
current branch).

A potential API design might rely on the following

  • Add a QueryBy() method to the BranchCollection in a similar way to the CommitCollection.QueryBy() method.
  • Rename the current Filter type to CommitFilter, in order to allow the creation of a BranchFIlter

Binding the following method might also be helpful. Related libgit2 tests can be found here.

/**
 * Find a merge base between two commits
 *
 * @param out the OID of a merge base between 'one' and 'two'
 * @param repo the repository where the commits exist
 * @param one one of the commits
 * @param two the other commit
 */
GIT_EXTERN(int) git_merge_base(
     git_oid *out,
     git_repository *repo,
     git_oid *one,
     git_oid *two);

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 con BranchCollection e confronta la sua API QueryBy() proposta con CommitCollection.QueryBy(). Esamina il tipo Filter attuale prima di prendere in considerazione la ridenominazione proposta, quindi ispeziona i test di revwalk/mergebase.c di libgit2 e il binding git_merge_base. Il lavoro è completo quando le query branch contains/merged/not-merged e la relativa API merge-base sono definite con test corrispondenti e il design dell’API è stato stabilito.

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

Valutazione

Stack tecnologico
csharp, git
Ambito
backend-api-design
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.