Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dirty version although there are no uncommited changes #53

Closed
eikaramba opened this issue Sep 17, 2018 · 11 comments
Closed

Dirty version although there are no uncommited changes #53

eikaramba opened this issue Sep 17, 2018 · 11 comments

Comments

@eikaramba
Copy link

eikaramba commented Sep 17, 2018

We have the problem that since quite some time the versionname is always dirty. First i thought there are uncommited changes in our CI system, but even when building the apk locally i get the "-dirty" versionname. the git repo is clean see here:
grafik

That's what i get after building or executing "gradle --quiet androidGitVersion":
grafik

do you any idea why that is happening? Is there something else i can have a look at or provide some other logs?

@eikaramba
Copy link
Author

eikaramba commented Sep 17, 2018

i saw that you don't do anything special here, that's why i'm confused myself of why that problem occurs.

@gladed
Copy link
Collaborator

gladed commented Sep 17, 2018

That does seem odd. I don't know enough about your project to reproduce the issue, but perhaps an update to jgit might help (it's a few versions old now). I'll ping here when it's ready.

@gladed
Copy link
Collaborator

gladed commented Sep 17, 2018

0.4.5 is published, please give it a try and see if the problem is fixed. If not, if you could point me at a dummy (or real) project that exhibits this behavior I can try to develop a workaround?

@eikaramba
Copy link
Author

eikaramba commented Sep 17, 2018

tried 0.4.5 no luck - like so often it seems it is a problem with our setup. i tried jgit for windows as described here: https://gist.github.com/oculushut/2413a93f311980f18910

then i was able to see that it detects some uncommited changes. git doesn't. it seems to be an issue with uppercase/lowercase in combination with windows maybe. I'm trying to resolve it now, but obviously this means it is not a problem of this library :)

@gladed
Copy link
Collaborator

gladed commented Sep 17, 2018

I agree. https://www.midgetontoes.com/2014/10/17/maven-jgitflow-working-tree-has-uncommitted-changes/ might give you some clues. Thanks for letting us know about it anyway!

@gladed gladed closed this as completed Sep 17, 2018
@gladed
Copy link
Collaborator

gladed commented Sep 17, 2018

BTW: as a workaround you can disable "dirty" detection by customizing the format. e.g.:

format "%tag%%-count%%-commit%%-branch%"

@1951FDG
Copy link

1951FDG commented Jan 20, 2019

I also have this issue: repo

I applied the workaround, but I still don't know what causes the project to be marked as dirty. Is there some debugging or logging possible to determine what may be causing this?

@GladeDiviney
Copy link
Contributor

We get the dirty report from jgit, so it may either be something on disk during the build, or it may be a problem with jgit. What OS is this on?

@1951FDG
Copy link

1951FDG commented Jan 22, 2019

Hi, I'm on macOS 10.11.6, using Android Studio 3.3

@1951FDG
Copy link

1951FDG commented Jan 22, 2019

Hi again, fixed it, I downloaded jgit.sh at https://www.eclipse.org/jgit/download/, and ran jgit.sh status and got:

Changes not staged for commit:

	deleted:    app/src/main/java/io/github/sdsstudios/nvidiagpumonitor/Controllers/BaseController.kt

Untracked files:

	app/src/main/java/io/github/sdsstudios/nvidiagpumonitor/controllers/BaseController.kt

Notice Controllers and controllers, jgit seems to be case sensitive compared to the system git git version 2.19.1

I did the following and committed the changes to fix the dirty status:

git rm -r --cached .
git add .

@gladed
Copy link
Collaborator

gladed commented Jan 22, 2019

Nice troubleshooting there! Thank you.

I wonder if git config core.ignorecase true would have made a difference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants