Git: Improve handling of ambigous ID input in checkout dialog#9123
Merged
matthiasblaesing merged 1 commit intoapache:masterfrom Jan 5, 2026
Merged
Conversation
In the checkout dialog users can enter object ids manually. As git allows using truncated IDs as identifiers, subsets of the complete id are valid inputs. When these are resolved an the id-part can't be resolved to a single object a dialog pops out telling users, that the commit does not exist. a) The message is wrong. An object with that abreviated id exists, it is just not one, but multiple. b) For the commit dialog the dialog stops the user while typing. This makes entering object id arkward. Both points are addressed here. Observed exception (causing the dialog): INFO [org.netbeans.modules.git]: The given id [7b] is not a commit or an annotated tag. org.eclipse.jgit.errors.AmbiguousObjectException: Object abbreviation 7b is ambiguous at org.eclipse.jgit.lib.Repository.resolveAbbreviation(Repository.java:925) at org.eclipse.jgit.lib.Repository.resolveSimple(Repository.java:853) at org.eclipse.jgit.lib.Repository.resolve(Repository.java:818) at org.eclipse.jgit.lib.Repository.resolve(Repository.java:474) at org.netbeans.libs.git.jgit.Utils.parseObjectId(Utils.java:286) Caused: org.netbeans.libs.git.GitException: The given id [7b] is not a commit or an annotated tag. at org.netbeans.libs.git.jgit.Utils.parseObjectId(Utils.java:290) at org.netbeans.libs.git.jgit.Utils.findCommit(Utils.java:265) at org.netbeans.libs.git.jgit.Utils.findCommit(Utils.java:261) at org.netbeans.libs.git.jgit.commands.LogCommand.run(LogCommand.java:109) at org.netbeans.libs.git.jgit.commands.GitCommand$1.run(GitCommand.java:56) at org.netbeans.libs.git.jgit.commands.GitCommand$1.run(GitCommand.java:53) at java.base/java.security.AccessController.doPrivileged(AccessController.java:251) at org.netbeans.libs.git.jgit.commands.GitCommand.execute(GitCommand.java:53) at org.netbeans.libs.git.GitClient.log(GitClient.java:941) at org.netbeans.modules.git.client.GitClient$38.call(GitClient.java:603) at org.netbeans.modules.git.client.GitClient$38.call(GitClient.java:599) at org.netbeans.modules.git.client.GitClient$CommandInvoker$1$1.call(GitClient.java:945) at org.netbeans.modules.git.client.GitClient$CommandInvoker$1.call(GitClient.java:968) at org.netbeans.modules.git.client.GitClient$CommandInvoker.runMethodIntern(GitClient.java:980) at org.netbeans.modules.git.client.GitClient$CommandInvoker.runMethod(GitClient.java:909) at org.netbeans.modules.git.client.GitClient$CommandInvoker.runMethod(GitClient.java:887) at org.netbeans.modules.git.client.GitClient.log(GitClient.java:599) [catch] at org.netbeans.modules.git.ui.repository.RevisionInfoPanelController$LoadInfoWorker.run(RevisionInfoPanelController.java:179) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403) at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the checkout dialog users can enter object ids manually. As git allows using truncated IDs as identifiers, subsets of the complete id are valid inputs. When these are resolved an the id-part can't be resolved to a single object a dialog pops out telling users, that the commit does not exist.
Both points are addressed here.
Screenshot of the problem:
Observed exception (causing the dialog):