Add sequencer support for multi-commit cherry-picking / revert

Abierto
#301 1 comentario 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
50/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java
Área
devtools

Línea de trabajo

Start in org.eclipse.jgit.api.CherryPickCommand and RevertCommand, at the point where CHERRY_PICK_HEAD/REVERT_HEAD is written when a multi-commit sequence is interrupted by a conflict. Study the sequencer/{todo,head,opts,abort-safety} semantics listed in the issue and locate where in the repository/RefDirectory layer such state files should be persisted. Done means a multi-commit cherry-pick or revert interrupted mid-sequence leaves a valid, git-compatible sequencer state (unsupported opts in sequencer/opts throw), single-commit operations still write only CHERRY_PICK_HEAD/REVERT_HEAD, and new tests alongside the existing cherry-pick/revert command tests cover this.

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

Descripción

Description

JGit's CherryPickCommand and RevertCommand currently only track a single in-progress operation via CHERRY_PICK_HEAD/REVERT_HEAD. When multiple commits are included in one call and a conflict interrupts the sequence partway through, JGit has no way to record which commits are still pending, so the operation can't be resumed, skipped, or aborted compatibly with native Git's git cherry-pick --continue/--skip/--abort (or vice versa).

Motivation

Native Git tracks multi-commit cherry-pick/revert sequences in $GIT_DIR/sequencer/{todo,head,opts,abort-safety}.

These files have the following semantics / include the following information:

  • head — the original HEAD before the sequence started.
  • todo — the remaining pick/revert <abbrev-sha> <subject> lines, rewritten before each commit is applied.
  • opts — the replay options used during pick/revert, stored in git-config format
  • abort-safety — the HEAD commit expected after each step, updated after every successful pick/revert.

JGit's CherryPickCommand and RevertCommand currently only support the strategy, no-commit and mainline options, so only these options would need to be persisted in sequencer/opts for now. If future support for --continue/--skip/--abort is added to JGit, encountering options not yet handled by JGit must be considered and handled appropriately (e.g. by throwing an exception).

If a cherry-pick/revert involves more than one commit, JGit must write/maintain the sequencer state throughout the pick/revert sequence. Single-commit operations do not write sequencer states and continues to only write CHERRY_PICK_HEAD/REVERT_HEAD.

Additional context

Persisting the sequencer state enables future JGit / EGit --continue/--skip/--abort support for multi-commit cherry-picks / reverts. This again is a pre-requisite for implementing multi-commit cherry-picks via the EGit UI (work started and currently blocked in https://github.com/eclipse-egit/egit/issues/192).

Lenguaje dominante
Java
Estrellas
427
Forks
116
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

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 eclipse-jgit/jgit

Todos los issues de eclipse-jgit/jgit

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.