-
Notifications
You must be signed in to change notification settings - Fork 103
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
Allow use of prefixes for useGitDescribe
case.
#133
Comments
Thanks for this very detailed issue description! Before going down this route, wouldn't it make sense to consider separate Git repos? As you are releasing the subprojects individually, this looks like the cleaner setup to me. |
Thanks for the quick response. In some cases, using separate Git repos does make sense. However there are examples where we have many submodules which need to be released separately, but we want to group the code together so that there's not a proliferation of Git repos that developers would have to check out separately. So we still have this need. |
Default value for scmInfo
I've encountered the same issue with our mono-repo that builds multiple projects with separate versioning. Without |
@sdether and others: when I dug into this back in June, I decided the best approach would be to add As it happens, looking at https://projects.eclipse.org/projects/technology.jgit/releases/4.9.0/review suggests it's due to be released today (what coincidence!) but as of writing it's not on Maven Central yet. |
PR #148 upgraded to the latest JGit, so this issue is now unblocked. I'm intending to have a look at this in the next few days. |
Any progress on this? |
@eliaslevy other things came up and distracted me! For the use case I have, in order to achieve what I need using
|
Also there is in fact a PR I raised in November for this issue (#149), which has been approved but not merged as there's one open question. I'll chase it now. |
@oliverlockwood how did you get around #144 even with your PR? I am running into the same issue with a multi project build. |
@eliaslevy by using the separate |
@oliverlockwood you may be interested in changes I made to the sbt-dynver plugin. |
@eliaslevy interesting, thanks for sharing. I look forward to this being sorted in a unified manner 😃 |
Background:
prefix
property.sbt-release
for the release logic, but for deriving version numbers implicitly from tagssbt-git
is the place to go.Diving into the details in
sbt-git
:useGitDescribe
invokes the equivalent ofgit describe --tags
, as documented here. For my project which includes two submodulesadapters
andtransformers
, this will always give me the tag of whatever was most recently released, rather than the one I'm interested in, for example:sbt-git
to set a tag prefix based on which module I'm interested in. Under the covers, this could usegit describe
's native regex matching, i.e.gitTagToVersionNumber
function. However, the tags passed to this function bysbt-git
are only the ones that explicitly match the current commit - thegitCurrentTags
value filters out any tag whose associated commit does not exactly match the commit at HEAD - so it doesn't find "closest match" tags in the way thatgit describe
does.JGit
doesn't yet support the--match
functionality.Next steps
I need this functionality, so I'll probably go down the road of implementing it myself. Rather than have it just a local change, I'd prefer to contribute it back as I imagine other developers may find it useful. To this end:
sbt-git
?--match
, and then use that; however it may be quicker to implement the--match
functionality locally. Or alternatively, you may prefer to update thegitCurrentTags
functionality to return all tags that relate to the current commit's history, rather than just to the current commit itself.Thanks for your time in reading this.
The text was updated successfully, but these errors were encountered: