Repository navigation
fix(kmono-git): add missing GraalVM reflect entry for DiffAlgorithm$SupportedAlgorithm - #48
Merged
julienvincent merged 1 commit intoMay 20, 2026
Conversation
…upportedAlgorithm
DiffFormatter.setRepository() internally calls Config.getEnum() which
uses reflection to invoke DiffAlgorithm$SupportedAlgorithm.values().
This fails in the native-image binary because the enum was not
registered in reflect-config.json.
The fix follows the same pattern as the other 16 JGit enums already
registered (CoreConfig$AutoCRLF, CoreConfig$EOL, etc.).
Without this fix, any kmono command that triggers file-level change
detection (--with-changes-since, --with-changes + ignore-changes)
crashes with:
java.lang.NoSuchMethodException:
org.eclipse.jgit.diff.DiffAlgorithm$SupportedAlgorithm.values()
Contributor
|
While the change makes sense, I'd just like to verify it on my side first as well. I cannot reproduce it with either of these: kmono query --with-changes-since origin/main --include-keys name -o json
kmono query --with-changes-since origin/main --filter-unchanged --include-keys name -o jsonI'm running version 4.12.1 Can you elaborate on what you are doing to trigger this issue? |
Contributor
Author
|
Tested with latest 4.12.1 and confirm crash: Seems to be related to
When |
Contributor
|
Confirmed, thanks! |
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.
Problem
Any
kmonoCLI command that triggers file-level change detection (--with-changes-since,--with-changescombined with--ignore-changes) crashes with:Reproducible with:
Cause
DiffFormatter.setRepository()(called fromk16.kmono.git.files/find-commit-changed-filesatfiles.clj:62) internally callsConfig.getEnum()which uses reflection to invokeDiffAlgorithm$SupportedAlgorithm.values(). This enum is not registered in the GraalVM native-image reflection config, so thevalues()method is stripped during compilation.Call chain:
Fix
Added
org.eclipse.jgit.diff.DiffAlgorithm$SupportedAlgorithmtopackages/kmono-git/resources/META-INF/native-image/org.eclipse.jgit/org.eclipse.jgit/reflect-config.json, following the same pattern as the 16 other JGit enums already registered (e.g.CoreConfig$AutoCRLF,CoreConfig$EOL,SHA1$Sha1Implementation, etc.).Verification
Built native binary from this branch and confirmed
--with-changes-sinceworks:Note: This PR is AI generated but I build the native binary locally and it works as expected. I am currently using a fork fix until this is addressed in kmono directly: https://github.com/ovistoica/kmono/releases/tag/v4.12.1-fix1