Git: Improve handling of ambigous ID input in checkout dialog by matthiasblaesing · Pull Request #9123 · apache/netbeans (original) (raw)

@matthiasblaesing

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)

@matthiasblaesing added this to the NB29 milestone

Jan 4, 2026

@matthiasblaesing matthiasblaesing added git

[ci] enable versioning job

ci:dev-build

[ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page)

labels

Jan 4, 2026

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

[ Show hidden characters]({{ revealButtonHref }})