libgit2 / libgit2/libgit2sharp

Question/Feature request: Rebase branch using a Tag as upstream

Abierto
#2,056 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
C#
Estrellas
3.5k
Forks
925
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

This is potentially a feature request, if there is no way of accomplishing this using the current version of LibGit2Sharp

I am trying to use LibGit2Sharp to rebase a feature branch using a Tag as upstream. The initial graph looks like this:

          * -- * -- * (featureA)
         /          
        /
 *--*--*--*--*--*--*--*--*--*--*--*-- (master)
       |        |        |        |    
       tag1    tag2     tag3    tag4    

The idea is to rebase featureA branch on master, but not on the HEAD of master (last commit), but rather on the commit corresponding to tag2.

The end result would be something like this:

                   * -- * -- * (featureA)
                  /          
                 /
 *--*--*--*--*--*--*--*--*--*--*--*-- (master)
       |        |        |        |    
       tag1    tag2     tag3    tag4 

The git syntax for this would be (and it works perfectly):

git rebase ref/tags/tag2 featureA

However, LibGit2Sharp syntax only allows passing in a Branch as argument for the upstream param.

var rebaseOptions = new RebaseOptions {...};
var identity = new Identity(...);

Branch branch = repo.Head;
Tag upstreamTag = repo.Tags[ontoTag]; 

var rebaseResult = repo.Rebase.Start(
    branch, 
    upstream, // <-- this is where I am struggling to pass in this Tag as upstream
    null, 
    identity, 
    rebaseOptions);

Is this achievable via LibGit2Sharp?

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.

Línea de trabajo

Comienza en repo.Rebase.Start y en los tipos RebaseOptions, Branch y Tag mostrados en el informe; compara el parámetro upstream con la búsqueda de tags del repositorio y con la sintaxis equivalente de git rebase. Se considerará terminado cuando se haya establecido si se puede aceptar un tag como upstream y, si no, se hayan definido el cambio necesario en la API y su cobertura de validación.

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

Evaluación

Stack tecnológico
csharp, git
Área
devtools
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.