vivin / gradle-semantic-build-versioning

Gradle plugin to generate version-numbers and tags using semantic versioning
MIT License
86 stars 32 forks source link

Incorrectly reporting working tree changes #68

Closed cwacekINV closed 7 years ago

cwacekINV commented 7 years ago

I'm running into an issue where executing ./gradlew tag fails with "Cannot create a tag when there are uncommitted changes", but git status responds with "nothing to commit, working tree clean".

I believe this is the same issue what was reported here, which was apparently an issue with JGit and which was fixed in JGit 4.5.

I tried to test updating JGit to 4.5.0, but the fact that S3 is down means I can't get to all sorts of resources necessary to build the plugin locally (like plugins.gradle.org 😞 ).

Platform: OS X 10.11

vivin commented 7 years ago

@cwacekINV Were you able to figure this out? This plugin also uses JGit and it looks like we will have to upgrade if that is the case. Thanks for reporting!

cwacekINV commented 7 years ago

So I'm still seeing the issue on my repo. I tried blowing away the repo and cloning it again and that didn't work. I tried upgrading the plugin to 4.5.0, and it didn't seem to have any effect. I even built a separate library that runs the same JGit call using a similar JGit version, and it didn't think there were any changes, so I'm not sure what's special about this plugin but the issue is real for me.

vivin commented 7 years ago

Did you say you tried building a local version of this plugin using JGit 4.5.0 and that still didn't fix the issue?

cwacekINV commented 7 years ago

Yes. Weirdly that didn't affect the issue. I was unable to successfully get a breakpoint into the plugin execution to see what it was doing, and I tried adding some print statements but then the tests broke due to extra output. At that point I bailed.

vivin commented 7 years ago

Yeah the plugin uses the following:

return new Git(repository)
    .status().call()
    .hasUncommittedChanges()

Did you verify that you were using your snapshot version of the plugin? It appears that we will still need to upgrade to JGit 4.5.0 anyway because there is that issue with 4.4.0 as you mentioned.

cwacekINV commented 7 years ago

I am 98% certain I was using my snapshot version. Which is to say, that there's a possibility that I wasn't. If you release a version with JGit@4.5.0 (or higher), I'll probably give it a go again, but I've unfortunately exhausted my time budget for trying to debug/fix myself. 😞

vivin commented 7 years ago

No worries :) I was just making sure because it would be hard for me to test this on my end since I'm on Linux. I will push up changes shortly and hopefully the new version will fix this. I am upgrading JGit to 4.6.0.

vivin commented 7 years ago

@cwacekINV I've just pushed up version 3.0.1; it is using JGit 4.6.0. Hopefully this will fix the issue for you!