Add branch querying/filtering feature

Abierto
#147 10 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
csharp, git

Línea de trabajo

Empieza con BranchCollection y compara su API QueryBy() propuesta con CommitCollection.QueryBy(). Revisa el tipo Filter actual antes de considerar el cambio de nombre propuesto y, después, inspecciona las pruebas de revwalk/mergebase.c de libgit2 y el binding de git_merge_base. Se considerará terminado cuando las consultas de branch contains/merged/not-merged y la API de merge-base relacionada estén definidas con pruebas coincidentes y el diseño de la API esté decidido.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

FeatReq

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);
Lenguaje dominante
C#
Estrellas
3.5k
Forks
925
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de libgit2/libgit2sharp

Todos los issues de libgit2/libgit2sharp

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.