-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Enhanced backup restore dialog #2961
Comments
Thank you for the long issue description including proposals. Can you
create a pull request? 😇 In other dialogs we had a similar discussion.
E.g., when closing a database with unsaved changes. @oscargus
|
Refs JabRef#149 |
I'll just add that I never used to see this popup but now see it all the time, whether or not I've saved the .bib file before exiting jabref. |
Me too, almost every time I open JabRef the popup appears. I'm usually clicking yes assuming that the backup file is a newer version of the bib file. I'm a right? |
I've noticed that the backup files (.bib.bak or .bib.sav) are often NOT newer than the .bib file. So I now open up my file manager, navigate to the folder and check the modification times before making my decision. There are times when it's good to have a backup that's older than the .bib file, for example when I delete an entry by accident and want to recover it. But most of the time I want the most recent changes. So maybe a button that can expand the window with "details" like modification times would be useful. The window expansion could include the answers to jonasstein's other questions. Going further, a diff would be the ultimate way of knowing which file I want to use. |
Really nice ideas! Could you offer some implementation help or know
someone who could support us? 😇 We could arrange a JabRef hackday where
some of our core developers are online for questions. In Germany, we have
in Stuttgart a kind of development lab for an onsite hack event.
|
I've got a bit much on for the next month or so, but if this is still open after that I might have a look at it. (I won't mind if someone jumps in and takes care of it before then!) Quick related question: what is the reason for having a backup file and an autosave file? |
The backup file is a relict from old JabRef times. The |
This issue still persists with JabRef 5.3. I get annoyed/irritated quite often, but still can't detect the issue behind. A simple solution would be to add some more information (modification date), as already suggested. Button 1: Use current file The third button should open the dialog which is also shown, when the file has been changed by an external program. With this solution one could
¹ I've had some times, when I copyied and pasted the bibtex code, without changing the bibtex key. This has led to broken bib file. I currently have my bib in a dropbox. But also in a git repo (which allows my to compare to a previous version easily). I would like to dispense on that additional "backup" step. |
f7648e8 introduced multiple backup files (10 to be exact), but the problem here is still valid:
|
Hi! Is this issue still available? If so, can I try it? |
To trigger the popup:
|
See also https://docs.jabref.org/advanced/autosave for where backups are stored |
Could you please elaborate what to be fixed here? Also all 3 buttons are working fine. |
@KotalaRadhika Good to see that you could bring up the dialog. Sadly, you did not show what happens at "Review backup" Now, let's walk through the original posters steps.
This is a general remark. Fortunately, the reporter refined it.
Heading for the following list. OK, let's read on.
This is already done. We see it in blue in the dialog.
By the button "Review backup", the next step should be clear
It should also be clear with the buttons. Hopefully
This should be in the dialog.
That information should be put into the dialog. I think, this is possible using the Bibdatabase Diff. -- The numbers for "Number of entries" and "Changes" should be calculated in a Background Task, because for large files, this could take time.
No need for place holders. Pass first the backup file and then the .bib file. The default tool is
I think, with "Ignore Backup" this is fulfilled.
Also done with "Ignore Backup" Hope, this helps In general, the issue refs This somehow refs #10853. . |
Even more refined: #11454 (comment) |
Technical hint: Use
|
Hello, we are the group of students who would like to work on this issue within the framework of our school project. We are commenting so that you assign the issu to us. Thank you ! I note that the group is composed of : |
@khola22 I can only assign students commenting on this PR. I think, for formality it is OK to assign one person of your group? |
Welcome to the vibrant world of open-source development with JabRef! Newcomers, we're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly. In case you encounter failing tests during development, please check our developer FAQs! Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback. Happy coding! 🚀 |
@khola22 I am so happy that a group of students chose this task. Please start from #11454 (comment). That should be enough for a requirements document. Then, you can add a directory for backups to You could even craft "real" a requirement document. See https://github.com/JabRef/jabref/blob/main/docs/requirements/index.md for hints. |
Hello!! We have evaluated two possible approaches for version restoration: first approach Moving the HEAD to the restored version: This method shifts the HEAD to the selected version, making it the latest commit. However, this approach rewrites the commit history, preventing the user from restoring intermediate versions. second approach Rewriting the current version with the content of the restored version: This method preserves the commit structure by copying the content of the restored version to the current version. This way, the entire history remains intact, and new commits naturally follow the initial HEAD. We would like to get your input on which approach you consider most appropriate for JabRef, taking into account flexibility and user experience. @nawalchahboune me |
Please do not re-invent git concepts. Never ever rewrite history!!! In short: Restore the file system contents. Then do a commit. Alternatives: You know that going back to a previous version is equal to a "git checkout commitid". And then git warns you that one works in a detached head. Then, one could work on a new branch. One could also reset the current branch to that commit. Then, the remote branch will diverge and will need more handling. |
Hello @koppor ! |
Nice! Where is the PR? 😅
None of us can judge without seeing the code. In general, think of JabRef also as CLI tool without any UI components. Then, JabRef should also work. Thus, the UI should be "dumb" and most logic should not be part of the UI... |
Hello @koppor , We apologize for the delayed response. We've been working on validating our code and relied heavily on loggers to debug (apologies for the clutter). Here's an update: backups are now tracked in a Git repository under jabref/backups, where .bib files are copied every 19 seconds to maintain a Git history. However, change detection currently occurs only when .bib files are overwritten, which is triggered by actions like Save, Save All, or the save prompt during exit. Our reliance on listeners for tracking edits imposes strict conditions, which limits dynamic change detection and leads to two main issues: The UI is mostly complete, but we are encountering challenges with the checkout functionality. We are uncertain if our current approach using JGit to revert commits is correct. On the positive side, commit retrieval, discarding changes, saving, and committing all work as intended. Since we replaced the BackupManager with a BackupManagerGit class, we adapted other components to integrate this new system. Being new to contributing on GitHub, we are unsure whether we should open a pull request (PR) to share our incomplete work for feedback or if there is another recommended process. Your guidance would be greatly appreciated! P.S.: We did not modify classes like CoarseChangeFilter for autosaving functionality. Best regards, |
@khola22 Thank you for the update. Please create a pull request. This enables us to investigate. |
@koppor the pull request is done ! |
This warning should tell the user exactly what the consequences of yes/no are. Some users want to create a backup or investigate the files manually, before answering the question.
A few ideas how to help the user:
The text was updated successfully, but these errors were encountered: