-
Notifications
You must be signed in to change notification settings - Fork 104
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
Support git describe
in versionformat
#60
Comments
After looking around this seems like what is being asked for in #55 as well? |
Yes, in principal I'm in favour of something more flexible, as long as it doesn't introduce security holes. |
One approach might be to support something like this:
So that if the closest tag was Although this has the limitation of only allowing a single string to be extracted from |
@aspiers There a rpm version issue with +4, as this leads to the situation, where v1.2.3.1 would be seen below v1.2.3+1. Better would be using '~' instead of '+', as this is special cased. |
@frispete Right - thanks for the heads up on that :) |
Actually, I think a better way of solving this would be to allow execution of an arbitrary command (which could be a script within the package) which would be responsible for determining the version, e.g.
or
However this would allow arbitrary command execution within source service runs, which could be a gaping security hole. @adrianschroeter Are server-side source service runs done in a security-isolated sandbox? i.e. is this a problem we already have to deal with in other source services, or would it be introducing a big new security issue? |
On Dienstag, 21. Juni 2016, 04:52:30 CEST wrote Adam Spiers:
this is IMHO not a good idea, it would make it quite dangerous to use the It should be always safe to checkout and build a package source
Adrian Schroeter SUSE Linux GmbH, GF: Felix Imend�rffer, Jane Smithard, Graham Norton, HRB 21284 (AG N�rnberg) Maxfeldstra�e 5 |
OK, forget that idea then ;-) |
I wrote:
Right now I can't think of a strong reason why that would be a problem. However even |
On Dienstag, 21. Juni 2016, 05:31:21 CEST wrote Adam Spiers:
Do you allow to inject sed regexp in one of our maintained services? It is fine to have a personal service running at build time run any scripts though. Adrian Schroeter SUSE Linux GmbH, GF: Felix Imend�rffer, Jane Smithard, Graham Norton, HRB 21284 (AG N�rnberg) Maxfeldstra�e 5 |
Not currently, but that was my previous suggestion.
Yeah, but at build-time is too late for determining the version, and that's the problem we're trying to solve here in a flexible manner. We could support the
feature only for local source service runs, and disable on server-side runs, or do you even see that as a risk? |
@boombatower Now that we merged your commit 960d0ce in #132, is that sufficient, or do we still need something more? |
This is a different issue entirely, but up to you what you want to do with this. Such problems are fun as that commit took two years, hehe. :) |
I'm probably being stupid, but I don't see how it's an entirely different issue - isn't it now possible to accomplish what you originally requested here, using |
I think the original post sums up the idea.
Sure one could use the versionrewrite to drop the v afterwards, but the idea was to use git describe directly. The idea being that the common patterns are either release tags or rolling commit based packages. Rather than have to copy/paste (after finding) or piece together all the parts for such a version why not just provide one built in? Currently, there are a variety of needless subtle differences between such packages including different separator characters like If anything this could be re-purposed as simply |
For projects using git it seems to make sense to just use
git describe
directly instead of including all the parts in the format.Perhaps
%gd
(gd = git describe)?Before I was pointed to this functionality I created https://github.com/boombatower/obs-git-update/blob/master/obs-git-update which uses the following.
Which results in something like:
v2.2.507.g0524a6f
. Can even add flags for always returning a result even if no tags. Nice since all in one does what you normally want and even includes the number of commits past the tag in addition to the commit hash. So in the examplev2.2
is latest tag and507
is the number of commit since that tag, then the abbreviated hash after that.Thoughts?
The text was updated successfully, but these errors were encountered: