Class Sequencer
java.lang.Object
io.github.jbastgen.stemma.git.sequence.Sequencer
Cherry-pick and revert of several commits, the same for both backends: a queue of commits that is applied one after the other
through a
SequenceEngine. When a commit conflicts, the state (what is left, how far it got, the message and author of
the commit that stopped) is written to .git/stemma-sequence/state.properties, so it survives a restart of the application;
continuing, skipping and aborting work from that file. Nothing here is specific to JGit or to the git command line.-
Constructor Summary
ConstructorsConstructorDescriptionSequencer(io.github.jbastgen.stemma.git.api.GitRepository repo, SequenceEngine engine) -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Gives up: the branch goes back to where it was before the series and the state is removed.io.github.jbastgen.stemma.git.api.SequenceKindWhat is in progress, from the state file;NONEwhen there is none or it cannot be read.io.github.jbastgen.stemma.git.api.SequenceResultnext()Continues after the conflicts were resolved and staged: commits the step, then runs the rest.io.github.jbastgen.stemma.git.api.SequenceResultskip()Leaves out the commit that stopped: its changes are thrown away, then the rest runs.io.github.jbastgen.stemma.git.api.SequenceResultstart(io.github.jbastgen.stemma.git.api.SequenceKind kind, List<String> commits, boolean recordOrigin, boolean noCommit, int mainline) Starts a series of commits and runs it until it is done or stops on a conflict.
-
Constructor Details
-
Sequencer
- Parameters:
repo- the repository to work onengine- the operations of the backend that apply and commit single steps
-
-
Method Details
-
inProgress
public io.github.jbastgen.stemma.git.api.SequenceKind inProgress()What is in progress, from the state file;NONEwhen there is none or it cannot be read. -
start
public io.github.jbastgen.stemma.git.api.SequenceResult start(io.github.jbastgen.stemma.git.api.SequenceKind kind, List<String> commits, boolean recordOrigin, boolean noCommit, int mainline) Starts a series of commits and runs it until it is done or stops on a conflict.- Parameters:
commits- the commits in the order they are appliedrecordOrigin- add the line "(cherry picked from commit …)"noCommit- apply the one commit to the working tree onlymainline- the parent whose side a merge commit is taken against; 0 for other commits- Throws:
io.github.jbastgen.stemma.git.api.GitException- if something else is in progress, the working tree is not clean or a commit cannot be used
-
next
public io.github.jbastgen.stemma.git.api.SequenceResult next()Continues after the conflicts were resolved and staged: commits the step, then runs the rest. -
skip
public io.github.jbastgen.stemma.git.api.SequenceResult skip()Leaves out the commit that stopped: its changes are thrown away, then the rest runs. -
abort
public void abort()Gives up: the branch goes back to where it was before the series and the state is removed.
-