Verified Owner
Top Fields Constructors Methods
org.jabref.gui.git

public Class GitCommitAction

extends SimpleCommand
Class Inheritance
Annotations
@NullMarked
Imports
java.nio.file.Path, java.util.Optional, java.util.function.Supplier, javafx.scene.control.Alert, .ButtonBar, .ButtonType, org.jabref.gui.DialogService, .LibraryTab, .StateManager, org.jabref.gui.actions.ActionHelper, .SimpleCommand, org.jabref.gui.exporter.SaveDatabaseAction, .SaveDatabaseAction.SaveDatabaseMode, .SaveDatabaseAction.SaveResult, org.jabref.gui.preferences.GuiPreferences, org.jabref.logic.JabRefException, org.jabref.logic.git.GitHandler, org.jabref.logic.git.status.GitStatusChecker, org.jabref.logic.git.util.GitHandlerRegistry, org.jabref.logic.journals.JournalAbbreviationRepository, org.jabref.logic.l10n.Localization, org.jabref.logic.util.BackgroundTask, .TaskExecutor, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntryTypesManager, org.jspecify.annotations.NullMarked, .Nullable, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final DialogService
private final BibEntryTypesManager
private final GitHandlerRegistry
private final JournalAbbreviationRepository
private static final Logger
private final GuiPreferences
private final StateManager
private final Supplier<@Nullable LibraryTab>
private final TaskExecutor
Inherited from org.jabref.gui.actions.SimpleCommand:
statusMessage

Constructor Summary

AccessConstructor and Description
public
GitCommitAction(Supplier<@Nullable LibraryTab> tabSupplier, DialogService dialogService, StateManager stateManager, GuiPreferences preferences, BibEntryTypesManager entryTypesManager, JournalAbbreviationRepository journalAbbreviationRepository, TaskExecutor taskExecutor, GitHandlerRegistry gitHandlerRegistry)

Method Summary

Modifier and TypeMethod and Description
private void
commit(Path bibFilePath)

private boolean
commitWithUnsavedChanges(LibraryTab libraryTab)

Without autosave the user decides when the library is written, so committing only the work already on disk stays available, as in other Git clients.

public void
private boolean
hasNothingToCommit(Path bibFilePath)

private void
initRepository(Path libraryFile)

Offers to put a library that is not under version control into a fresh repository.

private boolean
private boolean
save(LibraryTab libraryTab)

The save must not commit by itself: this one is on its way to the commit dialog.

Inherited from org.jabref.gui.actions.SimpleCommand:
getProgressprogressPropertysetExecutablestatusMessageProperty

Field Detail

dialogServiceback to summary
private final DialogService dialogService
entryTypesManagerback to summary
private final BibEntryTypesManager entryTypesManager
gitHandlerRegistryback to summary
private final GitHandlerRegistry gitHandlerRegistry
journalAbbreviationRepositoryback to summary
private final JournalAbbreviationRepository journalAbbreviationRepository
LOGGERback to summary
private static final Logger LOGGER
preferencesback to summary
private final GuiPreferences preferences
stateManagerback to summary
private final StateManager stateManager
tabSupplierback to summary
private final Supplier<@Nullable LibraryTab> tabSupplier
taskExecutorback to summary
private final TaskExecutor taskExecutor

Constructor Detail

GitCommitActionback to summary
public GitCommitAction(Supplier<@Nullable LibraryTab> tabSupplier, DialogService dialogService, StateManager stateManager, GuiPreferences preferences, BibEntryTypesManager entryTypesManager, JournalAbbreviationRepository journalAbbreviationRepository, TaskExecutor taskExecutor, GitHandlerRegistry gitHandlerRegistry)

Method Detail

commitback to summary
private void commit(Path bibFilePath)
commitWithUnsavedChangesback to summary
private boolean commitWithUnsavedChanges(LibraryTab libraryTab)

Without autosave the user decides when the library is written, so committing only the work already on disk stays available, as in other Git clients. impl->req~git.commit.unsaved-changes~1

executeback to summary
public void execute()
Annotations
@Override
hasNothingToCommitback to summary
private boolean hasNothingToCommit(Path bibFilePath) throws org.jabref.logic.JabRefException
initRepositoryback to summary
private void initRepository(Path libraryFile)

Offers to put a library that is not under version control into a fresh repository. Cancelling is a valid choice: the user may want to clone an existing repository into that folder instead.

isReadyToCommitback to summary
private boolean isReadyToCommit()
saveback to summary
private boolean save(LibraryTab libraryTab)

The save must not commit by itself: this one is on its way to the commit dialog.