Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git Integration and UI Improvements #12252

Open
wants to merge 93 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
094252c
l'ajout de la classe BackUpManagerJGit
nawalchahboune Oct 23, 2024
d0f6346
l'ajout de la classe BackUpManagerJGit
nawalchahboune Oct 23, 2024
7fd8f89
Merge remote-tracking branch 'origin/main'
nawalchahboune Oct 23, 2024
9ab37a2
l'ajout de la classe BackUpManagerJGit
nawalchahboune Oct 23, 2024
d8812ef
Add the class JGIT
Nov 6, 2024
af50c7c
first git implementation, not tested
Nov 6, 2024
e72d408
ajout de la methide backupGitDiffers
nawalchahboune Nov 6, 2024
d427e05
Added Pop up to choose backup
Nov 6, 2024
0737f48
adding methods 06/11
nawalchahboune Nov 6, 2024
f68236f
methods aded and changed : retrieveCommitDetails , retreiveCommits
nawalchahboune Nov 7, 2024
129d175
I start switching French comments to English
ilias-lwa3r Nov 11, 2024
b82682a
finish switching comments from French to English
ilias-lwa3r Nov 11, 2024
34a2889
Added table
Nov 12, 2024
b299e5f
Navigation through dialogs implemented
Nov 13, 2024
d2b3619
some modif
nawalchahboune Nov 19, 2024
d84fcab
some modif
nawalchahboune Nov 19, 2024
54fa60a
fix some issues
nawalchahboune Nov 19, 2024
9a8e615
adding date details
nawalchahboune Nov 19, 2024
62a8beb
Merge branch 'UI' into branch-1
Nov 19, 2024
df21a4d
Merge branch 'branch-1' of https://github.com/khola22/jabref into bra…
Nov 19, 2024
0f9fcb9
Revert "Merge branch 'branch-1' of https://github.com/khola22/jabref …
Nov 19, 2024
7b6ee3f
Reapply "Merge branch 'branch-1' of https://github.com/khola22/jabref…
Nov 19, 2024
b67b2d9
minor fixes
Nov 20, 2024
3f9584e
Minor Synthax fixes
Nov 20, 2024
76b6f92
supression de classe BackupManagerJGit
nawalchahboune Nov 20, 2024
fc94296
differenciation BackupManagerOld et BackupManager
nawalchahboune Nov 20, 2024
d6df47a
Corrected errors related to BackupManagerGit class
Nov 26, 2024
9a07077
Start tests
Nov 26, 2024
9c86a64
OpenDatabaseAction adapted
Nov 27, 2024
fa42e86
Start adapting SaveDatabaseAction.java and LibraryTab.java
Nov 27, 2024
be482cd
Classes adapted, except for UI
Nov 27, 2024
2797c01
UI update
Nov 27, 2024
27f7c47
Merge branch 'branch-1' of https://github.com/khola22/jabref into bra…
Nov 27, 2024
d070e67
Starting tests
Nov 27, 2024
528fe03
Starting tests
Nov 27, 2024
d40eadd
Merge remote-tracking branch 'origin/branch-1' into branch-1
Nov 27, 2024
11f65c7
first tests that are working
Nov 27, 2024
8ebb62a
All the tests for BackupManagerGit + Launcher working
Nov 28, 2024
562b285
Add some LOGGERS to BackupManagerGit.java
Nov 28, 2024
a2fa8b0
Adapted UI to BackupManagerGit for ChoiceDialog
Nov 29, 2024
1ad47a3
Adapted BackupUIManager to BackupManagerGit
Nov 29, 2024
a580032
Adapted Tests to UI adaptation
Nov 30, 2024
9a1c3a1
Added getter for name attribute of BackupEntry
Nov 30, 2024
1013c3c
Revert "Added getter for name attribute of BackupEntry"
Nov 30, 2024
4daf772
Final fix
Nov 30, 2024
ecad580
fixed the issue with detecting changes
Nov 30, 2024
c356375
Merge remote-tracking branch 'origin/branch-1' into branch-1
Nov 30, 2024
5d22a1a
editing the testRerieveCommitDetails test
nawalchahboune Nov 30, 2024
ae8583a
Fix the shutdown / usage of old BackupManager
Nov 30, 2024
44f4e17
correct path
Nov 30, 2024
19b0ef5
attempt to remove useless original path in some methods
nawalchahboune Dec 1, 2024
7f89d89
CORRECTING PATHS ! a clean launch (except for the 1st exception)
Dec 1, 2024
850e681
Merge remote-tracking branch 'origin/branch-1' into branch-1
Dec 1, 2024
119e5d0
Fixed the dialog of the 1st exception)
Dec 1, 2024
a7d271b
Fixed the infinite loops of commits
Dec 1, 2024
96c3239
Reversed backup list
Dec 1, 2024
5d0afe6
no more NULL for git initialization
Dec 1, 2024
7a48131
resolving prblm
nawalchahboune Dec 1, 2024
47d5238
Copying files to the backupdir logic
Dec 1, 2024
e881ce4
Add listeners
Dec 1, 2024
02fa1d1
Listeners detect changes but don't set needsBackup to true (I don't k…
Dec 1, 2024
c219a98
correct comment
Dec 2, 2024
5ae7407
Resolve the comment : Remove this here, we already have a newer versi…
Dec 2, 2024
ebe6f6b
Resolve the comment : delete this file (module-info.java), it's not n…
Dec 2, 2024
b0cc7f7
Adding BackupManagerGitTest class (with 5/5 passed tests)
nawalchahboune Dec 3, 2024
7085fc4
- Implement the unique file names in order to avoid conflicts when co…
Dec 4, 2024
3532d2e
The popup is available again
Dec 4, 2024
08b3c0c
Restore backup that functions
Dec 4, 2024
2c6da4b
Corrected retrieve commits / commits details
Dec 4, 2024
bca3558
Updated submodule abbrv.jabref.org
Dec 4, 2024
7e63aa2
Updated submodule csl-styles to latest commit
Dec 4, 2024
97caf34
Added support to review each change in a backup
Gillan0 Dec 4, 2024
b1c006e
Remove usage of BackupFileUtil in UI
Gillan0 Dec 4, 2024
aac4915
BackupResolverDialog.java doesn't use the old backup system anymore.
Dec 4, 2024
a292db3
change in CHANGELOG.md
Dec 5, 2024
7ae97d1
Updated submodule csl-locales to latest commit
Dec 5, 2024
5bbefcf
Merge branch 'main' into branch-1
khola22 Dec 5, 2024
70b123b
Update CHANGELOG.md
khola22 Dec 5, 2024
69ad0f3
CHANGELOG.md changes
Dec 5, 2024
a577ad9
Resolve comment on LibraryTab.java and BackupManagerGit.java
Dec 5, 2024
e55a831
Resolve comment on LibraryTab.java and BackupManagerGit.java
Dec 5, 2024
cf23e68
Resolve comment on BackupUIManager.java
Dec 5, 2024
61a1987
checkstyle
Dec 5, 2024
b515e51
Working Tests
Dec 5, 2024
8f06c80
Add missing submodule configuration
Dec 5, 2024
d3b6dd3
Apply OpenRewrite recipes
Dec 5, 2024
2a05da5
Correct Unit Tests
Dec 5, 2024
dbe6f2b
Added new UI text to JabRef_en.properties
Gillan0 Dec 6, 2024
3d13e22
Merge branch 'fix-localization-issues' into branch-1
Dec 6, 2024
e065399
Resolve comment on BackupManagerGitTest.java and
nawalchahboune Dec 7, 2024
01478c7
Resolve comments on insatantiation within mock
nawalchahboune Dec 13, 2024
e4ad25c
Merge branch 'main' into branch-1
khola22 Dec 13, 2024
da79d5d
Resolve comment about BackupUIManager.java
Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Added

- Implemented BackupManagerGit to handle automatic backups of .bib files using Git, ensuring centralized, version-controlled backup management. [#2961](https://github.com/JabRef/jabref/issues/2961)
Copy link
Member

@subhramit subhramit Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog entries are primarily for users, so they are not supposed to be aware of internal implementations or class names ("BackupManagerGit"). Just mention git-based version control. Ideally make entries short and crisp as well. For example:

Suggested change
- Implemented BackupManagerGit to handle automatic backups of .bib files using Git, ensuring centralized, version-controlled backup management. [#2961](https://github.com/JabRef/jabref/issues/2961)
- Implemented version-control based backup management of .bib files using Git. [#2961](https://github.com/JabRef/jabref/issues/2961)

- Added automatic copying of .bib files to a jabref/backups directory every 19 seconds with comprehensive commit history. [#2961](https://github.com/JabRef/jabref/issues/2961)
- Added support for unique file naming using UUIDs to prevent overwriting files with identical names in the backup directory. [#2961](https://github.com/JabRef/jabref/issues/2961)
Copy link
Member

@subhramit subhramit Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of internal implementation of the introduced feature and not a "change" from existing release. Remove this.

Copy link
Member

@subhramit subhramit Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khola22 Please do not mark review comments as resolved (except if it is trivially visible that it has been resolved). In this case, this was asked to be removed, and it is not (yet).
Once you push fresh commits on the code window, this will automatically be marked "Outdated". Then, one of the maintainers can take a look and mark them resolved.
This also allows for conversations in case you get stuck in a particular comment's context or amongst maintainers if there's any change of plans or someone suggests a better idea.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@subhramit okay ! sorry about that .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@subhramit okay ! sorry about that .

No issues, and no need to be sorry. It's on us to guide new contributors!

- Introduced UI functionality (only during opening) for saving, restoring, reviewing and discarding changes with accurate commit details retrieval. [#2961](https://github.com/JabRef/jabref/issues/2961)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of the introduced feature (also pertains to the same issue). Remove this as well.

- Enabled a "Restore" button to recover specific backup versions. [#2961](https://github.com/JabRef/jabref/issues/2961)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some user facing information should be kept, e.g. "enhanced backup and restore functionality".

- We added a Markdown export layout. [#12220](https://github.com/JabRef/jabref/pull/12220)
- We added a "view as BibTeX" option before importing an entry from the citation relation tab. [#11826](https://github.com/JabRef/jabref/issues/11826)
- We added support finding LaTeX-encoded special characters based on plain Unicode and vice versa. [#11542](https://github.com/JabRef/jabref/pull/11542)
Expand Down Expand Up @@ -52,6 +57,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Changed

- Refactored backup-related components to integrate with the new BackupManagerGit, replacing the older BackupManager logic. [#2961](https://github.com/JabRef/jabref/issues/2961)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internal implementation, not relevant to user-side. Remove.

- A search in "any" fields ignores the [groups](https://docs.jabref.org/finding-sorting-and-cleaning-entries/groups). [#7996](https://github.com/JabRef/jabref/issues/7996)
- When a communication error with an [online service](https://docs.jabref.org/collect/import-using-online-bibliographic-database) occurs, JabRef displays the HTTP error. [#11223](https://github.com/JabRef/jabref/issues/11223)
- The Pubmed/Medline Plain importer now imports the PMID field as well [#11488](https://github.com/JabRef/jabref/issues/11488)
Expand Down
1 change: 1 addition & 0 deletions jabref
Submodule jabref added at 470597
25 changes: 17 additions & 8 deletions src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.jabref.gui.autocompleter.SuggestionProvider;
import org.jabref.gui.autocompleter.SuggestionProviders;
import org.jabref.gui.autosaveandbackup.AutosaveManager;
import org.jabref.gui.autosaveandbackup.BackupManager;
import org.jabref.gui.autosaveandbackup.BackupManagerGit;
import org.jabref.gui.collab.DatabaseChangeMonitor;
import org.jabref.gui.dialogs.AutosaveUiManager;
import org.jabref.gui.entryeditor.EntryEditor;
Expand Down Expand Up @@ -105,6 +105,7 @@
import com.tobiasdiez.easybind.Subscription;
import org.controlsfx.control.NotificationPane;
import org.controlsfx.control.action.Action;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -308,7 +309,7 @@ private void onDatabaseLoadingStarted() {
getMainTable().placeholderProperty().setValue(loadingLayout);
}

private void onDatabaseLoadingSucceed(ParserResult result) {
private void onDatabaseLoadingSucceed(ParserResult result) throws GitAPIException, IOException {
OpenDatabaseAction.performPostOpenActions(result, dialogService, preferences);
if (result.getChangedOnMigration()) {
this.markBaseChanged();
Expand Down Expand Up @@ -343,7 +344,7 @@ private void onDatabaseLoadingFailed(Exception ex) {
dialogService.showErrorDialogAndWait(title, content, ex);
}

private void setDatabaseContext(BibDatabaseContext bibDatabaseContext) {
private void setDatabaseContext(BibDatabaseContext bibDatabaseContext) throws GitAPIException, IOException {
TabPane tabPane = this.getTabPane();
if (tabPane == null) {
LOGGER.debug("User interrupted loading. Not showing any library.");
Expand All @@ -367,13 +368,13 @@ private void setDatabaseContext(BibDatabaseContext bibDatabaseContext) {
installAutosaveManagerAndBackupManager();
}

public void installAutosaveManagerAndBackupManager() {
public void installAutosaveManagerAndBackupManager() throws GitAPIException, IOException {
if (isDatabaseReadyForAutoSave(bibDatabaseContext)) {
AutosaveManager autosaveManager = AutosaveManager.start(bibDatabaseContext);
autosaveManager.registerListener(new AutosaveUiManager(this, dialogService, preferences, entryTypesManager));
}
if (isDatabaseReadyForBackup(bibDatabaseContext) && preferences.getFilePreferences().shouldCreateBackup()) {
BackupManager.start(this, bibDatabaseContext, Injector.instantiateModelOrService(BibEntryTypesManager.class), preferences);
BackupManagerGit.start(this, bibDatabaseContext, Injector.instantiateModelOrService(BibEntryTypesManager.class), preferences);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

entryTypesManager is available as visible above. No need to inject.

}
}

Expand Down Expand Up @@ -750,7 +751,7 @@ private boolean confirmClose() {
}

if (buttonType.equals(discardChanges)) {
BackupManager.discardBackup(bibDatabaseContext, preferences.getFilePreferences().getBackupDirectory());
LOGGER.debug("Discarding changes");
return true;
}

Expand Down Expand Up @@ -798,7 +799,7 @@ private void onClosed(Event event) {
LOGGER.error("Problem when shutting down autosave manager", e);
}
try {
BackupManager.shutdown(bibDatabaseContext,
BackupManagerGit.shutdown(bibDatabaseContext,
preferences.getFilePreferences().getBackupDirectory(),
preferences.getFilePreferences().shouldCreateBackup());
} catch (RuntimeException e) {
Expand Down Expand Up @@ -1078,7 +1079,15 @@ public static LibraryTab createLibraryTab(BackgroundTask<ParserResult> dataLoadi

newTab.setDataLoadingTask(dataLoadingTask);
dataLoadingTask.onRunning(newTab::onDatabaseLoadingStarted)
.onSuccess(newTab::onDatabaseLoadingSucceed)
.onSuccess(result -> {
try {
newTab.onDatabaseLoadingSucceed(result);
} catch (Exception e) {
// We need to handle the exception.
// Handle the exception, e.g., log it or show an error dialog
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

LOGGER.error("An error occurred while loading the database", e);
}
})
.onFailure(newTab::onDatabaseLoadingFailed)
.executeWith(taskExecutor);

Expand Down
Loading
Loading