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

Comments

Projects
None yet
5 participants
@jakobgrunig

jakobgrunig commented Mar 19, 2015

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

This comment has been minimized.

Show comment
Hide comment
@jsuereth

jsuereth Mar 19, 2015

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.

Member

jsuereth commented Mar 19, 2015

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

This comment has been minimized.

Show comment
Hide comment
@charleskubicek

charleskubicek Apr 1, 2015

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

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

charleskubicek commented Apr 1, 2015

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

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

@metasim

This comment has been minimized.

Show comment
Hide comment
@metasim

metasim May 20, 2015

Member

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.

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

This comment has been minimized.

Show comment
Hide comment
@metasim

metasim May 20, 2015

Member

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
}
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 referenced this issue May 21, 2015

Merged

fix for #67 #88

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

This comment has been minimized.

Show comment
Hide comment
@dwijnand

dwijnand Dec 16, 2016

Member

Fixed in #88

Member

dwijnand commented Dec 16, 2016

Fixed in #88

@dwijnand dwijnand closed this Dec 16, 2016

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