Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 20 21:45
    SethTisue commented #187
  • Jul 20 21:45
    SethTisue opened #191
  • Jun 26 19:49
    limansky opened #190
  • Jun 21 07:45
    raboof commented #182
  • Jun 21 07:44
    raboof commented #188
  • Jun 21 00:15
    SethTisue commented #182
  • Jun 21 00:12
    SethTisue commented #187
  • Jun 13 17:44
    limansky commented #187
  • Jun 13 07:37
    raboof commented #187
  • Jun 12 22:41
    limansky commented #187
  • May 21 16:05
    raboof commented #157
  • May 21 15:38

    raboof on v1.0.1

    (compare)

  • May 21 15:31

    raboof on master

    Publish under 'com.typesafe' pr… (compare)

  • May 21 11:35
    raboof commented #188
  • May 21 11:34

    raboof on v1.1.0

    (compare)

  • May 21 11:31

    raboof on v1.1.0

    (compare)

  • May 21 09:53

    raboof on master

    Release all tags (compare)

  • May 21 09:52

    raboof on v1.1.0

    (compare)

  • May 21 09:51

    raboof on v1.1.0

    (compare)

  • May 21 09:50

    raboof on master

    Release all tags (compare)

Philipp Hoffmann
@philipphoffmann
hey everybody, first of all, great extension, very useful, i have a question though. we are using this extension as a dependency in one of our own sbt plugins. while trying to upgrade our own plugin to sbt 1.0 we found that sbt-git is not published for 1.0 yet. are there any plans to do so?
Philipp Hoffmann
@philipphoffmann
oh wait, i might have just figured that what i said is not true :D
Igal Benardete
@igalbenardete
Is there a way to get the current branch and the base branch of a pull request using this plugin ?
Michael Rubin
@mrubin
I’m not able to get my sbt prompt to change with sbt-git (using sbt 1.1.2, sbt-git 1.0.0)
I’ve enabled GitVersioning and GitBranchPrompt
I’m returning Some(“foo”) from git.gitTagToVersionNumber
I expect my prompt to change, but it does not
Michael Rubin
@mrubin
Can anyone help with sbt/sbt-git#161 ?
Ivano Pagano
@ivanopagano
hello everyone, dumb question, what's the most common way to use the plugin to run git commands from within other build tasks?
I'm looking at the plugin impl, but I'm afraid to tie myself too much to the underlying implementation... but I can't still figure out if there's an "exposed" api to do that
Luciano
@lJoublanc

Morning. I'm trying to use the versioning functionality but running into some problems. I just tagged my current branch, and see the following from git tag:

v0.2.0
v0.2.1

but when I run publishLocal, it's not picking up the tag. It's using a name of the form <sha>-SNAPSHOT instead.

So that appears to indicate that the plugin and versioning is working; but it's just not picking up the tag. Any ideas?
Ah just restarted SBT and it worked. Weird.
Ivano Pagano
@ivanopagano
about my previous question on running git commands I solved using Command.process("git ...", state) from a wrapping Command.command("myCmd") {...} definition, so I call sbt myCmd which in turn executes git from the sbt shell
bhaaratcrckt
@bhaaratcrckt_twitter
I've enabled this plugin. I can now run git status from inside the shell when in sbt. However, I am confused as to how to use the versioning feature of this plugin. in my build.sbt i have a hardcoded value version := "1.1.5". I don't want this hardcoded value but rather want it generated from this plugin. Is this possible to do ?
Ivano Pagano
@ivanopagano
@bhaaratcrckt_twitter simply remove the version key definition from your build
it will be computed for you
you can check it in the sbt calling show version
Jakub Kozłowski
@kubukoz
is there a quick way to get just the latest tag in sbt-git?
without any hashes, etc - just the latest existing tag
Ivano Pagano
@ivanopagano
there's a bunchful of useful vals in the exported object, let me check it for ya: https://github.com/sbt/sbt-git/blob/master/src/main/scala/com/typesafe/sbt/SbtGit.scala#L14
you'll find a gitCurrentTags which gives you a Seq of tags
in your sbt file you simply ask for git.gitCurrentTags as a SettingKey
@kubukoz :point_up:
keep in mind that any change to the git repo might need an sbt reload to update those values...
Jakub Kozłowski
@kubukoz
nope, gitCurrentTags gives me an empty seq
basically the situation is like this:
  • I tagged a commit on master
  • I committed a few times to master after that
  • I'm trying to get the latest tag on master
current tags, the way I see it, gives me an empty list because the current commit isn't part of any tag
Ivano Pagano
@ivanopagano
you could use git describe within a custom sbt task that would have to invoke the corresponding sbt command, provided by the plugin... I did go that path for some things and it's not too pretty, but it should be feasible... the complicated piece with sbt is that you want to call a command (that needs a build state) from a task, which has none. There's a Task already to get the state, but I couldn't yet figure out how to read sbt's logged output for the describe command as something that the task can return as a value...
BaghdadKh
@BaghdadKh
Hi , How do I fork an existing repo from my sbt ?
Naseem Mahasneh
@naseem91
Hi all ! Anyone know how to commit and push to git from sbt ?
Brian McKenna
@puffnfresh
our builds are failing at work because 0.8.5 for SBT 0.13
can not be found, did it get unpublished from Bintray?
0.8.5 seems to be missing, it did exist as of 4 days ago :/
Beck Gaël
@beckgael
Hello,
I would like to know how to deal with cross api/language version using sbt.
For example i would like to be able to build one jar with scala-2.11/spark-2.3.3 and another with scala-2.12-spark-2.4.4 in a multi sub project environment.
Thank you
Beck Gaël
@beckgael
Any clues since :) ? Or maybe i expressed not enough clearly :(
Brian P. Holt
@bpholt
@beckgael something like this might work:
libraryDependencies ++= {
  CrossVersion.partialVersion(scalaVersion.value) match {
    case Some((2, 12)) => Seq("organization" %% "artifact" % "version")
    case Some((2, 11)) => Seq("organization" %% "artifact" % "version")
    case _ => Nil
  }
}
but this question might get more traction in the sbt/sbt room; this room is more meant for questions about the sbt-git plugin
Beck Gaël
@beckgael
Thank you @bpholt, my bad for expose my issue not one the more appropriate place, i should be more carreful next time...
Pritam Kadam
@kpritam
I am using ghpages plugin which internally uses sbt-git
We have configured github actions workflow to publish docs to ghpages on remote repo
how do you pass github token to sbt-git? does sbt-git reads token from some file or env variable?
Beck Gaël
@beckgael
This message was deleted
Justin Reeves
@justinallenreeves
Am I using the plugin wrong?
Added it, started sbt succesully, git add ., git commit -m “added sb-git”, git push worked successfully
but then I want to git commit —amend after making some more changes and it hung, I wonder if it’s because it wants to open my $EDITOR and doesn’t know how
Justin Reeves
@justinallenreeves
Also anyone know how to get the GitBranchPrompt plugin to work with PlayScala?
Jason Yeo
@jsyeo:matrix.org
[m]
is this project still being maintained?
it looks abandoned. the last release was in 2018 :(
Zachary LeFevre
@zachlefevre

I need to access the git SHA from within my code. Ideally I'd be able to access the current sha from the buildInfo object generated by the sbt-buildinfo plugin.

I'm having a hard time.
I have .enablePlugins(sbtbuildinfo.BuildInfoPlugin, GitVersioning) on a common project, and addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") in my plugins.sbt file.

How do I now access git properties (specifically the git head sha) ?

Zachary LeFevre
@zachlefevre
I've found a solution.
In my build I do:
import com.typesafe.sbt.SbtGit.GitKeys.gitHeadCommit
...
    buildInfoKeys := Seq[BuildInfoKey] (name, version, scalaVersion, sbtVersion, "gitsha" -> {gitHeadCommit.value}),
raboof
@raboof:matrix.org
[m]
Jason Yeo: not very actively, as you noticed, but I just did a release a few weeks ago
1 reply