jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Show "Nothing to commit" if there is nothing to commit

Open subhramit opened this issue 3 months ago • 18 comments

  1. Open example library
  2. Save
  3. Set up Git from File -> Git
  4. Make some changes in the library but don't save (or make no changes at all)
  5. Go to git -> commit and put a commit message, and commit Notice that no warning is shown even though there were no changes and thus no commit pushed - giving the user a false impression that a commit was pushed (or more dangerously, they may think their library was indeed saved after the change which it was not). Show the message "Working tree clean, nothing to commit" to the user in that case.

subhramit avatar Aug 27 '26 08:08 subhramit

/assign-me

raghvendrasingh-01 avatar Aug 27 '26 10:08 raghvendrasingh-01

👋 Hey @raghvendrasingh-01, thank you for your interest in this issue! 🎉

We're excited to have you on board. Start by exploring our Contributing guidelines, and set up your local development workspace by following the steps in our workspace setup guidelines to get started smoothly.

For questions on JabRef functionality, you can consult the JabRef Guru. For questions related to the codebase, please start using DeepWiki.

In case you encounter failing tests during development, please check our developer FAQs!

Still facing issues or having more questions? Feel free to ask here on GitHub or on JabRef's Gitter chat. Please don't hesitate to open a (draft) pull request early on to show the direction you are heading towards if unsure.

Happy coding! 🚀

jabref-machine avatar Aug 27 '26 10:08 jabref-machine

Hey, please note https://github.com/JabRef/jabref/issues/16703#issuecomment-5437025687

Try to reproduce with bib file in a proper directory vs on desktop

subhramit avatar Aug 27 '26 10:08 subhramit

Pasting it directly here:

NOTE These errors apparently surface when you put the bib file in desktop, which is forbidden to be made a git directory. We can reuse this:

Image

Search for this string and check when this is triggered

subhramit avatar Aug 27 '26 11:08 subhramit

⏰ Assignment Reminder

Hi @raghvendrasingh-01, this is a friendly reminder about your assignment to this issue.

[!WARNING] This issue will be automatically unassigned in 4 days if there's no activity.

Remember that you can ask the JabRef Guru or DeepWiki about anything regarding JabRef. Additionally, our contributing guide has hints on creating a pull request and a link to our Gitter chat.

How to keep your assignment


If you are working on it, you can prevent automatic unassignment by:

  • Submitting a draft pull request with your progress within 4 days
  • Asking for the 📌 Pinned label if you need more time

We appreciate your contribution and are here to help if needed!

github-actions[bot] avatar Aug 30 '26 12:08 github-actions[bot]

Hi @raghvendrasingh-01! Just checking in to see if you're still working on this issue. Since the 4-day window wraps up today, no worries at all if you got busy - I'd be more than happy to take it over and help out!

cmarqueslau avatar Sep 03 '26 14:09 cmarqueslau

Hi @raghvendrasingh-01! Just checking in to see if you're still working on this issue. Since the 4-day window wraps up today, no worries at all if you got busy - I'd be more than happy to take it over and help out!

Hey, feel free to try reproducing the issue and working on it.

subhramit avatar Sep 03 '26 16:09 subhramit

/assign-me

cmarqueslau avatar Sep 03 '26 17:09 cmarqueslau

⚠️ Issue Already Assigned

Hi @cmarqueslau, this issue is currently assigned to @raghvendrasingh-01.

[!NOTE] If no progress is made within 8 days, the issue will be automatically unassigned.

Options for contributors
  • Wait for availability: The issue may become available if auto-unassigned
  • Collaborate: You can ask the assignee if they want help
  • Maintainer assistance: A maintainer can add you as co-assignee if appropriate

jabref-machine avatar Sep 03 '26 17:09 jabref-machine

/assign @cmarqueslau

subhramit avatar Sep 03 '26 18:09 subhramit

Thank you for your continued work in JabRef. At this point, you probably already know the basics and the important links. If not, our contributing guidelines is the place you should go to.

At this point in time, you raised 1 pull request(s) of which 0% (0/1) have been merged.

jabref-machine avatar Sep 03 '26 18:09 jabref-machine

Hey @subhramit! I'm having trouble replicating this issue. Could you record a video of it? I recorded a video showing my attempts to reproduce it:

https://github.com/user-attachments/assets/e0da294b-48ac-4eef-9c0e-1b505f602d4b

cmarqueslau avatar Sep 03 '26 21:09 cmarqueslau

Pasting it directly here:

NOTE These errors apparently surface when you put the bib file in desktop, which is forbidden to be made a git directory. We can reuse this:

Image Search for this string and check when this is triggered

The key was this for me ^ Putting the bib file in the desktop (as the entire desktop would then be attempted to be made a git repository folder when you try configuring and comitting)

subhramit avatar Sep 05 '26 17:09 subhramit

Since multiple issues have to go wrong for the issue to trigger and this is "just" about a notification and JabRef also has automatic backups in case things go wrong, the urgency of this issue is not high. I will remove this from the beta milestone, as we are aiming for a release within the next few days.

Also, maybe it would be good to have a separate notification for when the git path is desktop (which apparently is forbidden)?

ThiloteE avatar Sep 06 '26 10:09 ThiloteE

Github is broken. Cannot remove this issue from the beta-milestone xD

ThiloteE avatar Sep 06 '26 10:09 ThiloteE

Since multiple issues have to go wrong for the issue to trigger

well yeah it's not that urgent, but there is only one precondition for this (at least for me) - just put the bib file in desktop.

subhramit avatar Sep 06 '26 10:09 subhramit

Another is to actually use the git feature and the user has to take a deliberate decision, so it will hit a subgroup of a subgroup of users. We still have it on the milestones and priority on high, because a danger of dataloss, so we will not forget about this one. If @cmarqueslau will open a PR today, it might make it into the beta, of course.

ThiloteE avatar Sep 06 '26 12:09 ThiloteE

This no longer happens in current main, potentially post https://github.com/JabRef/jabref/pull/16722. For a bib file placed on desktop, commit fails with the following:

Image
org.eclipse.jgit.api.errors.JGitInternalException: Missing unknown 0000000000000000000000000000000000000000
	at [email protected]/org.eclipse.jgit.api.StatusCommand.call(StatusCommand.java:128)
	at org.jabref.jablib/org.jabref.logic.git.status.GitStatusChecker.checkStatus(GitStatusChecker.java:33)
	at java.base/java.util.Optional.map(Optional.java:260)
	at org.jabref/org.jabref.gui.git.GitCommitAction.hasNothingToCommit(GitCommitAction.java:161)
	at org.jabref/org.jabref.gui.git.GitCommitAction.commit(GitCommitAction.java:87)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at org.jabref/org.jabref.gui.git.GitCommitAction.execute(GitCommitAction.java:73)
	at org.jabref/org.jabref.gui.actions.JabRefAction.lambda$new$1(JabRefAction.java:23)
	at [email protected]/org.controlsfx.control.action.Action.handle(Action.java:423)
	at [email protected]/org.controlsfx.control.action.Action.handle(Action.java:64)
	at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at [email protected]/javafx.event.Event.fireEvent(Event.java:199)
	at [email protected]/javafx.scene.control.MenuItem.fire(MenuItem.java:459)
	at [email protected]/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1426)
	at [email protected]/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$6(ContextMenuContent.java:1379)
	at [email protected]/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
	at [email protected]/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at [email protected]/javafx.event.Event.fireEvent(Event.java:199)
	at [email protected]/javafx.scene.Scene$MouseHandler.process(Scene.java:4134)
	at [email protected]/javafx.scene.Scene.processMouseEvent(Scene.java:1953)
	at [email protected]/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2802)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.get(GlassViewEventHandler.java:353)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.get(GlassViewEventHandler.java:255)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:429)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:387)
	at [email protected]/com.sun.glass.ui.View.handleMouseEvent(View.java:573)
	at [email protected]/com.sun.glass.ui.View.notifyMouse(View.java:970)
	at [email protected]/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.win.WinApplication.lambda$runLoop$0(WinApplication.java:173)
	at java.base/java.lang.Thread.run(Thread.java:1474)
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing unknown 0000000000000000000000000000000000000000
	at [email protected]/org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:152)
	at [email protected]/org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:216)
	at [email protected]/org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:1175)
	at [email protected]/org.eclipse.jgit.revwalk.RevWalk.parseTree(RevWalk.java:1113)
	at [email protected]/org.eclipse.jgit.lib.IndexDiff.<init>(IndexDiff.java:298)
	at [email protected]/org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:616)
	at [email protected]/org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:392)
	at [email protected]/org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:366)
	at [email protected]/org.eclipse.jgit.api.StatusCommand.call(StatusCommand.java:122)
	... 48 more

and share library fails with:

Image
org.eclipse.jgit.api.errors.JGitInternalException: Missing unknown 0000000000000000000000000000000000000000
	at [email protected]/org.eclipse.jgit.api.StatusCommand.call(StatusCommand.java:128)
	at org.jabref.jablib/org.jabref.logic.git.status.GitStatusChecker.checkStatus(GitStatusChecker.java:33)
	at org.jabref.jablib/org.jabref.logic.git.status.GitStatusChecker.checkStatusAndFetch(GitStatusChecker.java:83)
	at org.jabref/org.jabref.gui.git.GitShareToGitHubDialogViewModel.doShareToGitHub(GitShareToGitHubDialogViewModel.java:157)
	at org.jabref/org.jabref.gui.git.GitShareToGitHubDialogViewModel.lambda$shareToGitHub$0(GitShareToGitHubDialogViewModel.java:119)
	at org.jabref.jablib/org.jabref.logic.util.BackgroundTask$1.call(BackgroundTask.java:69)
	at org.jabref/org.jabref.gui.util.UiTaskExecutor$1.call(UiTaskExecutor.java:188)
	at [email protected]/javafx.concurrent.Task$TaskCallable.call(Task.java:1407)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
	at java.base/java.lang.Thread.run(Thread.java:1474)
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing unknown 0000000000000000000000000000000000000000
	at [email protected]/org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:152)
	at [email protected]/org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:216)
	at [email protected]/org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:1175)
	at [email protected]/org.eclipse.jgit.revwalk.RevWalk.parseTree(RevWalk.java:1113)
	at [email protected]/org.eclipse.jgit.lib.IndexDiff.<init>(IndexDiff.java:298)
	at [email protected]/org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:616)
	at [email protected]/org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:392)
	at [email protected]/org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:366)
	at [email protected]/org.eclipse.jgit.api.StatusCommand.call(StatusCommand.java:122)
	... 13 more

@cmarqueslau closing this in lieu of https://github.com/JabRef/jabref/issues/16703 as it is more related and potential PR https://github.com/JabRef/jabref/pull/16707 Please pick up any other issue if interested.

subhramit avatar Sep 06 '26 15:09 subhramit