On Thursday 21 November 2013 12:38:13 Greg Banks wrote:
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.
Not really, check your /usr/lib/obs/services directory :-) osc already demands some services, depending on which OBS projects you work. So you should have some of those installed. If you want local invocation or disabled mode, you need them anyway.
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-freetyp e-go/_service?expand=1> git: https://build.opensuse.org/package/view_file/devel:languages:go/g o-assert/_service?expand=1> 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.
Well, the source service XML metadata files aren't Bible chapters, so they may contain mistakes. But we allow pull requests :-) -- With kind regards, Sascha Peilicke SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nuernberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer HRB 16746 (AG Nürnberg)