Class RealRepoController

java.lang.Object
io.github.jbastgen.stemma.app.git.RealRepoController

public final class RealRepoController extends Object
Carries out the actions of one real (not sample) repository view through the Git backend and keeps the view's RepoState up to date.

Every action runs off the JavaFX thread, one after the other per repository (see RepositoryService.submit(java.nio.file.Path, java.util.function.Function<io.github.jbastgen.stemma.git.api.GitRepository, T>)), reports its result as a toast, and finishes by reloading the repository, so the view always shows what is really on disk. All methods must be called on the JavaFX thread.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Called with the reason when a push was rejected and a forced push could be offered; the view sets it.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RealRepoController(RepositoryService service, Path workTree, RepoState state, Host host, Runnable refresh)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Abandons the merge; the branch is as it was.
    static List<io.github.jbastgen.stemma.git.api.BackupInfo>
    allBackups(io.github.jbastgen.stemma.git.api.GitRepository repo)
    The backups of all kinds, newest first.
    void
    amend(String summary, String description, Runnable onSuccess)
    Replaces the last commit by one with this message and the staged changes (none is fine: only the message changes).
    void
    applyStash(int index)
    Applies a stash and keeps it.
    boolean
    autoFetch(boolean prune, Consumer<AutoFetch.Outcome> onDone)
    Feature 54: fetches all remotes without a word (no toast, no reload unless something changed) and tells the caller how it went.
    void
    checkout(String branch)
    Switches to the branch.
    void
    checkoutRemote(String remote, String branch)
    Checks out a branch that only exists on a remote: a local tracking branch is created, or the local one is used.
    void
    Asks a remote which tags it has, so that the side panel can mark the tags that exist only here.
    void
    cherryPick(List<String> commitIds, boolean recordOrigin, boolean noCommit, int mainline)
    Copies commits onto the current branch.
    void
    cherryPick(List<String> commitIds, boolean recordOrigin, boolean noCommit, int mainline, boolean copyLabels)
    As above; copyLabels gives each new commit the labels of the commit it was copied from.
    void
    commit(String summary, String description, Runnable onSuccess)
    Commits.
    Builds a privacy-filtered prompt for the next commit message off the UI thread.
    void
    createBranch(String name, String startCommit, boolean checkout)
    Creates a branch at the commit, optionally switching to it.
    void
    createTag(String name, String commitId, String message)
    Creates a tag, without pushing it.
    void
    createTag(String name, String commitId, String message, String pushTo)
    Creates a tag and, when pushTo names a remote, pushes it there right away.
    void
    deleteBranch(String name, boolean force, Runnable onNotMerged)
    Deletes a local branch; onNotMerged is called if git refuses because it is not fully merged.
    void
    Deletes a tag on a remote; the local tag stays.
    void
    Deletes the tag.
    void
    Discards the local changes of the files.
    void
    Discards these files of the working tree (see DiscardPlan): modified and deleted files go back to HEAD, new files are removed, untracked files are deleted, or moved to the trash when the settings say so.
    void
    discardLines(String path, Set<String> keys, boolean hunk)
    Throws away the lines of path with these keys from the working tree.
    void
    dropStash(int index)
    Drops the stash.
    void
    exportZip(String commitId, Path target, String topFolder)
    Writes the files of a commit as a Zip archive in the background and tells where it is and how big it is.
    void
    Fetches the remotes one after the other, in this order (null or empty: all remotes of the repository).
    void
    flowFinish(Kind kind, String branch, String tagMessage)
    Finishes the given branch (full name, e.g.
    void
    flowFinish(Kind kind, String branch, String tagMessage, boolean squash, String squashMessage)
    Finishes the given branch; with squash its commits are combined into one when merged.
    void
    flowInit(String production, String development)
    Sets Git Flow up with the default prefixes.
    void
    Runs the set-up of the wizard: the first commit if wanted, the branch, the configuration, the checkout and the push.
    void
    flowStart(Kind kind, String name)
    Starts a feature, release or hotfix.
    void
    Reads what the Git Flow wizard needs (off the UI thread) and hands it, with the current configuration, to then.
    void
    forcePush(io.github.jbastgen.stemma.git.api.PushForce force)
    Pushes the current branch over the remote one: with the lease, or (only when the settings allow) without.
    void
    ignore(IgnoreFile.Target target, List<String> patterns, List<String> samplePaths)
    Writes the lines to the ignore file and tells what happened (written, or already ignored).
    void
    loadBlame(String revision, String path, io.github.jbastgen.stemma.git.api.BlameOptions options, BiConsumer<List<io.github.jbastgen.stemma.git.api.BlameLine>,String> then)
    Blames a file as it is in a revision (wip = the last commit) in the background (feature 47); then gets the lines or, when it fails, null and the reason, on the UI thread.
    void
    Counts the lines of the text files of the last commit in the background; then gets the result on the UI thread.
    Reads message and changes of the commits for a description (off the JavaFX thread).
    void
    loadCommitStats(int limit, Consumer<List<io.github.jbastgen.stemma.git.api.CommitStat>> then)
    Reads the commits with their files and lines in the background; then gets them on the UI thread.
    void
    loadDetails(String commitId)
    Starts loading message body and changed files of a commit, once.
    void
    loadDiff(String sel, String path)
    Starts loading the diff of one file, once.
    void
    loadFileBytes(String sel, String path, Consumer<byte[]> then)
    The content of a file in a commit, or in the working tree for wip; null when it is not there.
    void
    loadFileHistory(String path, boolean follow, int limit, BiConsumer<List<io.github.jbastgen.stemma.git.api.FileCommit>,String> then)
    The commits that changed a file or folder, in the background (feature 46); then gets them, or null and the reason, on the UI thread.
    void
    The paths of the files of a commit (wip = HEAD); then gets them on the UI thread, null when it fails.
    void
    loadFileText(String sel, String path, Consumer<String> onText)
    Reads the text of a file for the preview: from the working tree for "wip", else as it was in the commit; the text goes to onText on the UI thread, null when the file is not there or is not text.
    void
    The summary and the description of the last commit, for amending it; null when the history is empty.
    void
    loadImages(String newSel, String oldRef, String path, Consumer<ImageFiles.Versions> onLoaded)
    Reads the two versions of a picture file for the diff view: newSel is "wip" (the working tree) or a commit, oldRef the commit it is compared with (null: the file is new, there is no earlier version).
    void
    Finds out which key the repository has in the label index; once.
    void
    loadStashDetails(int index, Consumer<io.github.jbastgen.stemma.git.api.StashDetails> then)
    Reads the files of a stash and hands them to then on the UI thread (nothing on a failure: a toast says why).
    void
    loadStashDiff(String commitId, String path, Consumer<List<DiffLine>> then)
    The changes of one file of a stash commit, as lines.
    void
    merge(String branch)
    Merges the branch into the current one, with the message the template gives.
    void
    merge(String branch, String message)
    Merges with a message of the user; an empty message means the configured template.
    mergeMessagePrompt(String source, String target, String kind)
    The prompt for the message of a merge, a squash or a tag (feature 4): the commits that source brings into target and the message template.
    static String
    The message of the underlying failure, without the wrapper exceptions of the futures.
    void
    openFileOfCommit(String commitId, String path)
    Opens a file as it was in a commit: a read-only copy is written to the folder for opened files and opened with the system's program.
    void
    popStash(int index)
    Applies the stash and drops it.
    void
    previewReset(String target, IntConsumer onCount)
    Asks how many commits a reset to target takes off the branch (-1: it could not be told).
    static void
    pruneBackups(io.github.jbastgen.stemma.git.api.GitRepository repo)
    Deletes the backups that are older than the time they are kept; a failure is only logged, they stay until next time.
    void
    Pulls: fetches and merges the upstream.
    void
    Pushes the current branch; a branch without upstream is published and its upstream is set.
    void
    Pushes all tags that the remote does not have.
    void
    pushTag(String remote, String tag)
    Pushes one tag to a remote.
    void
    rebase(String onto)
    Replays the current branch on top of onto.
    void
    Abandons the rebase; the branch is as it was.
    void
    Continues the rebase after the conflicts were resolved.
    void
    rebaseInteractive(String onto, List<io.github.jbastgen.stemma.git.api.RebaseStep> steps)
    Rebases onto onto with the steps of the interactive rebase dialog.
    void
    Skips the commit that conflicts and continues.
    void
    Loads the repository again and updates the view.
    void
    Reloads only if something changed since the last load: asks for the changed files and the branches (two cheap reads) instead of everything.
    void
    renameBranch(String oldName, String newName, String alsoOnRemote)
    Renames a local branch.
    The name of the repository: the folder name.
    void
    reset(String target, String label, io.github.jbastgen.stemma.git.api.ResetMode mode)
    Moves the current branch to target.
    void
    Resolves one conflicting file: with the external tool of the settings if one is chosen and the file is text, else in Stemma's own merge tool.
    void
    revert(List<String> commitIds, boolean noCommit, int mainline)
    Makes commits that undo the given ones.
    void
    Abandons the cherry-pick or revert; the branch is as it was.
    void
    Continues the cherry-pick or revert after the conflicts were resolved.
    void
    Leaves out the commit that stopped the cherry-pick or revert.
    void
    setAllStaged(boolean staged)
    Stages every file of the working tree, or unstages them all ("Select all").
    void
    setLabels(String commitId, Set<String> labelIds)
    Gives a commit exactly these labels.
    void
    setStaged(List<FileChange> files, boolean staged)
    Stages these files, or unstages them; conflicted files are not staged this way (see setAllStaged(boolean)).
    void
    squash(int count, String message)
    Replaces the last count commits by one with message.
    void
    stageHunk(String path, String headerLine)
    Stages the hunk of path whose header is headerLine.
    void
    stageLines(String path, Set<String> keys)
    Stages the lines of path with these keys (see Hunks.ChangeLine), feature 50.
    void
    Stashes all changes, untracked files included.
    void
    stash(String message, io.github.jbastgen.stemma.git.api.StashOptions options)
    Stashes what the options say, with a message of the user's own (blank = git's).
    void
    stashBranch(int index, String branch)
    Makes a branch where the stash was made, with the stash applied to it.
    void
    Stops tracking the files (they stay on the disk, and the next commit removes them from the repository) and ignores them: Git ignores only files it does not track.
    void
    Stages a file, or unstages it when it is staged; a file with conflict markers cannot be staged.
    void
    undoReset(io.github.jbastgen.stemma.git.api.BackupInfo backup)
    Brings back what a hard reset took: the files as they were (changes, untracked files, deletions) and the branch at the commit it was at.
    void
    unstageHunk(String path, String headerLine)
    Unstages the hunk of path whose header is headerLine.
    void
    unstageLines(String path, Set<String> keys)
    Unstages the lines of path with these keys.
    void
    withCopyOfCommitFile(String commitId, String path, Consumer<Path> then)
    Writes a read-only copy of a file as it was in a commit (see OpenedFiles) and hands it to then on the UI thread.
    void
    writeChangelog(String content, boolean stage)
    Writes the changelog file in the working tree and, if wanted, stages it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • offerForcePush

      public Consumer<String> offerForcePush
      Called with the reason when a push was rejected and a forced push could be offered; the view sets it.
  • Constructor Details

    • RealRepoController

      public RealRepoController(RepositoryService service, Path workTree, RepoState state, Host host, Runnable refresh)
      Parameters:
      service - the application service that runs the Git work
      workTree - the repository
      state - the state the view shows; changed only on the JavaFX thread
      host - what the controller needs of the window: toasts, settings, services
      refresh - redraws the view after a reload
  • Method Details

    • reload

      public void reload()
      Loads the repository again and updates the view. Also used when the window regains focus.
    • reloadIfChanged

      public void reloadIfChanged()
      Reloads only if something changed since the last load: asks for the changed files and the branches (two cheap reads) instead of everything. Used when the window is used again.
    • loadDetails

      public void loadDetails(String commitId)
      Starts loading message body and changed files of a commit, once. The view is refreshed when they arrive.
    • loadDiff

      public void loadDiff(String sel, String path)
      Starts loading the diff of one file, once. sel is a commit id or "wip".
    • setAllStaged

      public void setAllStaged(boolean staged)
      Stages every file of the working tree, or unstages them all ("Select all"). Files with unresolved conflicts are not staged this way: staging one marks it resolved, which has to be decided for each file.
    • setStaged

      public void setStaged(List<FileChange> files, boolean staged)
      Stages these files, or unstages them; conflicted files are not staged this way (see setAllStaged(boolean)).
    • toggleStaged

      public void toggleStaged(String path)
      Stages a file, or unstages it when it is staged; a file with conflict markers cannot be staged.
    • stageHunk

      public void stageHunk(String path, String headerLine)
      Stages the hunk of path whose header is headerLine.
    • unstageHunk

      public void unstageHunk(String path, String headerLine)
      Unstages the hunk of path whose header is headerLine.
    • stageLines

      public void stageLines(String path, Set<String> keys)
      Stages the lines of path with these keys (see Hunks.ChangeLine), feature 50.
    • unstageLines

      public void unstageLines(String path, Set<String> keys)
      Unstages the lines of path with these keys.
    • discardLines

      public void discardLines(String path, Set<String> keys, boolean hunk)
      Throws away the lines of path with these keys from the working tree. A backup of the working tree is written first (if the settings say so) and the message offers Undo; when the backup fails nothing is discarded.
    • commit

      public void commit(String summary, String description, Runnable onSuccess)
      Commits. With nothing staged, everything is staged first ("Commit all"). During a merge nothing is staged automatically: resolved files must be staged on purpose, so conflict markers are never committed by accident.
    • loadHeadMessage

      public void loadHeadMessage(Consumer<String[]> onMessage)
      The summary and the description of the last commit, for amending it; null when the history is empty.
    • amend

      public void amend(String summary, String description, Runnable onSuccess)
      Replaces the last commit by one with this message and the staged changes (none is fine: only the message changes). The labels of the old commit move to the new one, because the label index is keyed by commit id.
    • openFileOfCommit

      public void openFileOfCommit(String commitId, String path)
      Opens a file as it was in a commit: a read-only copy is written to the folder for opened files and opened with the system's program.
    • loadFileText

      public void loadFileText(String sel, String path, Consumer<String> onText)
      Reads the text of a file for the preview: from the working tree for "wip", else as it was in the commit; the text goes to onText on the UI thread, null when the file is not there or is not text.
    • loadImages

      public void loadImages(String newSel, String oldRef, String path, Consumer<ImageFiles.Versions> onLoaded)
      Reads the two versions of a picture file for the diff view: newSel is "wip" (the working tree) or a commit, oldRef the commit it is compared with (null: the file is new, there is no earlier version). A side the file does not exist on is null; the result goes to onLoaded on the UI thread (null when reading failed).
    • withCopyOfCommitFile

      public void withCopyOfCommitFile(String commitId, String path, Consumer<Path> then)
      Writes a read-only copy of a file as it was in a commit (see OpenedFiles) and hands it to then on the UI thread.
    • ignore

      public void ignore(IgnoreFile.Target target, List<String> patterns, List<String> samplePaths)
      Writes the lines to the ignore file and tells what happened (written, or already ignored).
    • stopTrackingAndIgnore

      public void stopTrackingAndIgnore(IgnoreFile.Target target, List<String> paths)
      Stops tracking the files (they stay on the disk, and the next commit removes them from the repository) and ignores them: Git ignores only files it does not track.
    • discardFiles

      public void discardFiles(List<FileChange> files)
      Discards these files of the working tree (see DiscardPlan): modified and deleted files go back to HEAD, new files are removed, untracked files are deleted, or moved to the trash when the settings say so.
    • discard

      public void discard(Collection<String> paths)
      Discards the local changes of the files.
    • stash

      public void stash()
      Stashes all changes, untracked files included.
    • stash

      public void stash(String message, io.github.jbastgen.stemma.git.api.StashOptions options)
      Stashes what the options say, with a message of the user's own (blank = git's).
    • applyStash

      public void applyStash(int index)
      Applies a stash and keeps it. A conflict is reported and leaves the stash where it is.
    • stashBranch

      public void stashBranch(int index, String branch)
      Makes a branch where the stash was made, with the stash applied to it.
    • loadStashDetails

      public void loadStashDetails(int index, Consumer<io.github.jbastgen.stemma.git.api.StashDetails> then)
      Reads the files of a stash and hands them to then on the UI thread (nothing on a failure: a toast says why).
    • loadStashDiff

      public void loadStashDiff(String commitId, String path, Consumer<List<DiffLine>> then)
      The changes of one file of a stash commit, as lines.
    • popStash

      public void popStash(int index)
      Applies the stash and drops it.
    • dropStash

      public void dropStash(int index)
      Drops the stash.
    • checkout

      public void checkout(String branch)
      Switches to the branch.
    • checkoutRemote

      public void checkoutRemote(String remote, String branch)
      Checks out a branch that only exists on a remote: a local tracking branch is created, or the local one is used.
    • createBranch

      public void createBranch(String name, String startCommit, boolean checkout)
      Creates a branch at the commit, optionally switching to it.
    • deleteBranch

      public void deleteBranch(String name, boolean force, Runnable onNotMerged)
      Deletes a local branch; onNotMerged is called if git refuses because it is not fully merged.
    • merge

      public void merge(String branch)
      Merges the branch into the current one, with the message the template gives.
    • merge

      public void merge(String branch, String message)
      Merges with a message of the user; an empty message means the configured template.
    • mergeMessagePrompt

      public CompletableFuture<String> mergeMessagePrompt(String source, String target, String kind)
      The prompt for the message of a merge, a squash or a tag (feature 4): the commits that source brings into target and the message template. Built off the UI thread; files and diffs are not sent.
      Parameters:
      kind - merge, squash or tag
    • loadFilePaths

      public void loadFilePaths(String sel, Consumer<List<String>> then)
      The paths of the files of a commit (wip = HEAD); then gets them on the UI thread, null when it fails.
    • loadFileBytes

      public void loadFileBytes(String sel, String path, Consumer<byte[]> then)
      The content of a file in a commit, or in the working tree for wip; null when it is not there.
    • loadBlame

      public void loadBlame(String revision, String path, io.github.jbastgen.stemma.git.api.BlameOptions options, BiConsumer<List<io.github.jbastgen.stemma.git.api.BlameLine>,String> then)
      Blames a file as it is in a revision (wip = the last commit) in the background (feature 47); then gets the lines or, when it fails, null and the reason, on the UI thread.
    • loadFileHistory

      public void loadFileHistory(String path, boolean follow, int limit, BiConsumer<List<io.github.jbastgen.stemma.git.api.FileCommit>,String> then)
      The commits that changed a file or folder, in the background (feature 46); then gets them, or null and the reason, on the UI thread.
      Parameters:
      follow - follow a file across renames (not for a folder)
    • loadCommitStats

      public void loadCommitStats(int limit, Consumer<List<io.github.jbastgen.stemma.git.api.CommitStat>> then)
      Reads the commits with their files and lines in the background; then gets them on the UI thread.
    • loadCodeMetrics

      public void loadCodeMetrics(Consumer<CodeMetrics> then)
      Counts the lines of the text files of the last commit in the background; then gets the result on the UI thread.
    • writeChangelog

      public void writeChangelog(String content, boolean stage)
      Writes the changelog file in the working tree and, if wanted, stages it.
    • loadCommitData

      public CompletableFuture<List<CommitData>> loadCommitData(List<String> ids)
      Reads message and changes of the commits for a description (off the JavaFX thread).
    • repoName

      public String repoName()
      The name of the repository: the folder name.
    • commitMessagePrompt

      public CompletableFuture<String> commitMessagePrompt()
      Builds a privacy-filtered prompt for the next commit message off the UI thread.
    • loadLabelKey

      public void loadLabelKey()
      Finds out which key the repository has in the label index; once.
    • setLabels

      public void setLabels(String commitId, Set<String> labelIds)
      Gives a commit exactly these labels.
    • rebase

      public void rebase(String onto)
      Replays the current branch on top of onto.
    • rebaseInteractive

      public void rebaseInteractive(String onto, List<io.github.jbastgen.stemma.git.api.RebaseStep> steps)
      Rebases onto onto with the steps of the interactive rebase dialog.
    • rebaseContinue

      public void rebaseContinue()
      Continues the rebase after the conflicts were resolved.
    • rebaseSkip

      public void rebaseSkip()
      Skips the commit that conflicts and continues.
    • rebaseAbort

      public void rebaseAbort()
      Abandons the rebase; the branch is as it was.
    • cherryPick

      public void cherryPick(List<String> commitIds, boolean recordOrigin, boolean noCommit, int mainline)
      Copies commits onto the current branch.
      Parameters:
      commitIds - oldest first
    • cherryPick

      public void cherryPick(List<String> commitIds, boolean recordOrigin, boolean noCommit, int mainline, boolean copyLabels)
      As above; copyLabels gives each new commit the labels of the commit it was copied from.
    • revert

      public void revert(List<String> commitIds, boolean noCommit, int mainline)
      Makes commits that undo the given ones.
    • sequenceContinue

      public void sequenceContinue()
      Continues the cherry-pick or revert after the conflicts were resolved.
    • sequenceSkip

      public void sequenceSkip()
      Leaves out the commit that stopped the cherry-pick or revert.
    • sequenceAbort

      public void sequenceAbort()
      Abandons the cherry-pick or revert; the branch is as it was.
    • squash

      public void squash(int count, String message)
      Replaces the last count commits by one with message.
    • resolve

      public void resolve(String path)
      Resolves one conflicting file: with the external tool of the settings if one is chosen and the file is text, else in Stemma's own merge tool. Files that cannot be merged line by line (binary, deleted on one side) ask which version to keep.
    • abortMerge

      public void abortMerge()
      Abandons the merge; the branch is as it was.
    • createTag

      public void createTag(String name, String commitId, String message)
      Creates a tag, without pushing it.
    • createTag

      public void createTag(String name, String commitId, String message, String pushTo)
      Creates a tag and, when pushTo names a remote, pushes it there right away.
    • pushTag

      public void pushTag(String remote, String tag)
      Pushes one tag to a remote.
    • pushAllTags

      public void pushAllTags(String remote)
      Pushes all tags that the remote does not have.
    • deleteRemoteTag

      public void deleteRemoteTag(String remote, String tag)
      Deletes a tag on a remote; the local tag stays.
    • checkRemoteTags

      public void checkRemoteTags(String remote)
      Asks a remote which tags it has, so that the side panel can mark the tags that exist only here. A network call, so it only happens when the user asks for it.
    • renameBranch

      public void renameBranch(String oldName, String newName, String alsoOnRemote)
      Renames a local branch. Git Flow's configuration follows when it is the production or development branch; alsoOnRemote (a remote name, or null) publishes the new name there, makes it the upstream and deletes the old name on that remote.
    • deleteTag

      public void deleteTag(String name)
      Deletes the tag.
    • previewReset

      public void previewReset(String target, IntConsumer onCount)
      Asks how many commits a reset to target takes off the branch (-1: it could not be told).
    • reset

      public void reset(String target, String label, io.github.jbastgen.stemma.git.api.ResetMode mode)
      Moves the current branch to target. A hard reset first writes a backup (if the settings say so) and then offers Undo in its message; when the backup fails nothing is reset.
      Parameters:
      label - how the user calls the target (a short id, a branch or a tag name)
    • undoReset

      public void undoReset(io.github.jbastgen.stemma.git.api.BackupInfo backup)
      Brings back what a hard reset took: the files as they were (changes, untracked files, deletions) and the branch at the commit it was at. What is in the working tree now is saved in a backup of its own first, so that the undo can be undone.
    • allBackups

      public static List<io.github.jbastgen.stemma.git.api.BackupInfo> allBackups(io.github.jbastgen.stemma.git.api.GitRepository repo)
      The backups of all kinds, newest first.
    • pruneBackups

      public static void pruneBackups(io.github.jbastgen.stemma.git.api.GitRepository repo)
      Deletes the backups that are older than the time they are kept; a failure is only logged, they stay until next time.
    • fetchRemotes

      public void fetchRemotes(List<String> remotes)
      Fetches the remotes one after the other, in this order (null or empty: all remotes of the repository). A remote that fails (network down, wrong credentials) does not stop the others; one message at the end reports everything.
    • autoFetch

      public boolean autoFetch(boolean prune, Consumer<AutoFetch.Outcome> onDone)
      Feature 54: fetches all remotes without a word (no toast, no reload unless something changed) and tells the caller how it went. Never asks for a password: the backends run without a terminal, so a repository that needs one simply fails.
      Returns:
      false when there was nothing to do (no remotes), onDone is not called then
    • exportZip

      public void exportZip(String commitId, Path target, String topFolder)
      Writes the files of a commit as a Zip archive in the background and tells where it is and how big it is.
    • pull

      public void pull()
      Pulls: fetches and merges the upstream.
    • forcePush

      public void forcePush(io.github.jbastgen.stemma.git.api.PushForce force)
      Pushes the current branch over the remote one: with the lease, or (only when the settings allow) without.
    • push

      public void push()
      Pushes the current branch; a branch without upstream is published and its upstream is set.
    • flowInit

      public void flowInit(String production, String development)
      Sets Git Flow up with the default prefixes.
    • flowWizardFacts

      public void flowWizardFacts(BiConsumer<GitFlowPlanner.Facts,GitFlowConfig> then)
      Reads what the Git Flow wizard needs (off the UI thread) and hands it, with the current configuration, to then.
    • flowSetUp

      public void flowSetUp(GitFlowWizard.Choice choice)
      Runs the set-up of the wizard: the first commit if wanted, the branch, the configuration, the checkout and the push.
    • flowStart

      public void flowStart(Kind kind, String name)
      Starts a feature, release or hotfix.
    • flowFinish

      public void flowFinish(Kind kind, String branch, String tagMessage)
      Finishes the given branch (full name, e.g. feature/login).
    • flowFinish

      public void flowFinish(Kind kind, String branch, String tagMessage, boolean squash, String squashMessage)
      Finishes the given branch; with squash its commits are combined into one when merged.
    • message

      public static String message(Throwable error)
      The message of the underlying failure, without the wrapper exceptions of the futures.