G'day, On 21 November 2013 00:42, Sascha Peilicke <speilicke@suse.com> wrote:
On Wednesday 20 November 2013 10:24:33 Greg Banks wrote:
4. Source services could be better documented. A lot better. For example I discovered @PARENT_TAG@ by reading the source.
I guess I'm partly to blame here. The tar_scm source service documents that feature in it's parameter manifest (/usr/lib/obs/services/tar_scm.service). But I agree there is currently no easy way to introspect a service how to really use it. That would probably be an osc feature.
If so, osc would have to pull down the .service file from the server. But I'd settle for online documentation in the WebUI, perhaps generated from the .service file.
The "versionformat" parameter capabilities depend on the underlying SCM. So they look slightly different depending on that, here are some best-practice examples:
mercurial: https://build.opensuse.org/package/view_file/devel:languages:go/go-freetype-... git: https://build.opensuse.org/package/view_file/devel:languages:go/go-assert/_s...
In git's case, the tar_scm service uses --pretty-format=... A quick check of the man-page reveals:
%ad: author date (format respects --date= option)
For --date, stackoverflow has all the answers with examples (that are also found in the man-page):
http://stackoverflow.com/questions/7853332/git-log-date-formats
So everything is already there.
Yes, I got what I want using %cd in versionformat. Unfortunately the description in the .service file implies - incorrectly - that the version string will be exactly what "git log --pretty=format:" would give, which is *not* true. Firstly the output is sanitised with a sed script. Secondly git is given the --date=short option which changes the output of %cd. So just from reading the documentation I would never have tried %cd. -- Greg. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org