Class DiscardPlan
java.lang.Object
io.github.jbastgen.stemma.app.git.DiscardPlan
What discarding a selection of working-tree files means, and what to tell the user before doing it. A modified or
deleted file returns to its state in HEAD; a new file that is staged is removed from the index and from the disk; a
file that Git does not know yet (untracked) is deleted, which is the only thing Git cannot bring back; a file with an
unresolved conflict is left for a separate question.
-
Method Summary
Modifier and TypeMethodDescriptionMenu entry and button text for this selection.The files with conflicts; they need their own confirmation, since discarding them abandons the resolution.The warning for files with conflicts.The question of the second confirmation for files with conflicts.static Stringdone(int discarded, int deleted) The message after it was done.static booleanGit does not know the file yet: a new file that is not staged.static Stringlist(List<FileChange> files) One name per line, the first 6, then "… and N more".message()The names (the first few) and what happens to them; always ends with what cannot be undone.static DiscardPlanof(List<FileChange> files) Sorts the files into the groups that are discarded differently: with conflicts, untracked, new and staged, and changed tracked files.booleanOnly untracked files: the action is a Delete, not a Discard.ordinary()The files that can be discarded after one confirmation: everything except the conflicted ones.title()The question of the confirmation dialog.
-
Method Details
-
isUntracked
Git does not know the file yet: a new file that is not staged. -
of
Sorts the files into the groups that are discarded differently: with conflicts, untracked, new and staged, and changed tracked files. -
ordinary
The files that can be discarded after one confirmation: everything except the conflicted ones. -
conflicted
The files with conflicts; they need their own confirmation, since discarding them abandons the resolution. -
onlyUntracked
public boolean onlyUntracked()Only untracked files: the action is a Delete, not a Discard. -
actionLabel
Menu entry and button text for this selection. -
title
The question of the confirmation dialog. -
message
The names (the first few) and what happens to them; always ends with what cannot be undone. -
conflictTitle
The question of the second confirmation for files with conflicts. -
conflictMessage
The warning for files with conflicts. -
list
One name per line, the first 6, then "… and N more". -
done
The message after it was done.
-