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.

Evaluación

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

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.

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?

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.