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

Wrong version when using git describe? #67

Closed
jakobgrunig opened this issue Mar 19, 2015 · 5 comments
Closed

Wrong version when using git describe? #67

jakobgrunig opened this issue Mar 19, 2015 · 5 comments

Comments

@jakobgrunig
Copy link

When I have git.useGitDescribe set to true I noticed the following:

  1. I tag HEAD to 'v0.8.0' and 'sbt version' returns '0.8.0'
  2. I commit something and 'sbt version' returns something like 'v0.8.0-1-gbeea47d'

Shouldn't this be '0.8.0-1-gbeea47d'?

@jsuereth
Copy link
Member

probably, but I think we're using the "raw" git describe output. Would have to alter how we filter out the "v". Could be an easy fix if you're interested.

@charleskubicek
Copy link

Our current work-around is to override the gitDescribedVersion setting:

git.gitDescribedVersion <<= git.gitDescribedVersion((v) => v.map(_.drop(1)))

@metasim
Copy link
Member

metasim commented May 20, 2015

Scratch that... didn't fix the problem like I thought. something indeed appears to be getting cached.

My git version is 2.2.0.

I was having a similar problem but fixed it with this:

git.gitTagToVersionNumber := { tag: String =>
  if(tag matches "v[0.9]+\\..*") Some(tag.drop(1))
  else None
}

Wondering if something is funky with the default git.gitTagToVersionNumber function.

@metasim
Copy link
Member

metasim commented May 20, 2015

If I combine charleskubicek 's solution with overriding git.gitTagToVersionNumber, I get the behavior I'd expect.:

git.gitDescribedVersion <<= git.gitDescribedVersion((v) => v.map(_.drop(1)))

git.gitTagToVersionNumber := { tag: String =>
  if(tag matches "v[0.9]+\\..*") Some(tag.drop(1))
  else None
}

lrytz added a commit to lrytz/sbt-git that referenced this issue May 21, 2015
@lrytz lrytz mentioned this issue May 21, 2015
lrytz added a commit to lrytz/sbt-git that referenced this issue Jun 7, 2015
lrytz added a commit to lrytz/sbt-git that referenced this issue Jun 8, 2015
lrytz added a commit to lrytz/sbt-git that referenced this issue Jun 8, 2015
fernandomora added a commit to fernandomora/sbt-git that referenced this issue Jun 20, 2015
fernandomora added a commit to fernandomora/sbt-git that referenced this issue Jun 20, 2015
fernandomora added a commit to fernandomora/sbt-git that referenced this issue Jun 21, 2015
jsuereth added a commit that referenced this issue Jul 17, 2015
@dwijnand
Copy link
Member

Fixed in #88

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

No branches or pull requests

5 participants