Interface SequenceEngine


public interface SequenceEngine
What a backend has to do for Sequencer: apply one commit to the index and the working tree, commit the index, and go back. Everything else (the queue, the state that survives a restart, continue, skip, abort) is shared.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
     
    static final record 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    apply(io.github.jbastgen.stemma.git.api.SequenceKind kind, String commit, int mainline)
    Applies the changes of the commit (cherry-pick) or their opposite (revert) to the index and the working tree without committing.
    void
    Removes the files that a cherry-pick or revert leaves in .git (CHERRY_PICK_HEAD, REVERT_HEAD, MERGE_MSG).
    Commits what is staged with this message; author is null for the current identity.
    The .git folder; the state of a series is kept in a folder of its own inside it.
    The commit HEAD points to, or null in a repository without commits.
    meta(String commit)
    The commit for a name or id, with what is needed to repeat or undo it; throws a GitException if there is none.
    void
    resetHard(String commit)
    Moves the branch and the working tree to the commit and discards all changes (reset --hard).
  • Method Details

    • gitDir

      Path gitDir()
      The .git folder; the state of a series is kept in a folder of its own inside it.
    • head

      String head()
      The commit HEAD points to, or null in a repository without commits.
    • meta

      The commit for a name or id, with what is needed to repeat or undo it; throws a GitException if there is none.
    • apply

      boolean apply(io.github.jbastgen.stemma.git.api.SequenceKind kind, String commit, int mainline)
      Applies the changes of the commit (cherry-pick) or their opposite (revert) to the index and the working tree without committing. mainline is 0 for a commit with one parent.
      Returns:
      true when it applied cleanly, false when there are conflicts (the files carry them)
      Throws:
      io.github.jbastgen.stemma.git.api.GitException - if local changes would be overwritten or it fails otherwise
    • commit

      String commit(String message, SequenceEngine.Author author)
      Commits what is staged with this message; author is null for the current identity. Returns the new commit id.
    • resetHard

      void resetHard(String commit)
      Moves the branch and the working tree to the commit and discards all changes (reset --hard).
    • clearMarkers

      void clearMarkers()
      Removes the files that a cherry-pick or revert leaves in .git (CHERRY_PICK_HEAD, REVERT_HEAD, MERGE_MSG).