karmann-dm / gradle-versions-plugin

Gradle plugin for automatic version management. Inspired by SemVer
MIT License
4 stars 0 forks source link

Cryptic error message when previous tag has been created manually #5

Open Szer opened 3 years ago

Szer commented 3 years ago

Repro

Expected

0.0.2

Actual

Cannot read field "w1" because "src" is null

More info

It happens because this tag couldn't be "peeled" to commit behind it, so code here https://github.com/karmann-dm/gradle-versions-plugin/blob/ba3c8812f4f9dae1dfb5d328e2d851e2e8e875ac/src/main/java/com/karmanno/plugins/services/PrepareVersionService.java#L28

returns null on .getPeeledObjectId() which later causes failure inside jgit library

Workaround

Don't tag manually? But that could be difficult in monorepos or some weird setups.

karmann-dm commented 3 years ago

Fixed here https://github.com/karmann-dm/gradle-versions-plugin/releases/tag/2.0.0 Now if tag is not recognized as a canonical one will be simply ignored