Who we are

We are the developers of Plastic SCM, a full version control stack (not a Git variant). We work on the strongest branching and merging you can find, and a core that doesn't cringe with huge binaries and repos. We also develop the GUIs, mergetools and everything needed to give you the full version control stack.

If you want to give it a try, download it from here.

We also code SemanticMerge, and the gmaster Git client.

Getting stats with the query system

Friday, August 10, 2007 Pablo Santos 0 Comments

The query system is one of the new features we released with Plastic 1.5. It opens up new possibilities to create customized statistics and know what is going on in your development.

We wanted to make the query system as simple as possible (you can always argue here if you don't like it) and that’s why we decided to create a SQL-like syntax. This way, taking into account that our users are actually developers, we provide a familiar interface.

Well, suppose you want to list the revisions you created since yesterday. In my case I would type:
$ cm find revs where date “>” ‘2007/08/9’ and owner = ‘pablo’

Ok, but what about giving all this output a bit of format? You can use the –format modifier and type something like:
$ cm find revs where date “>” ‘2007/08/9’ and owner=’pablo’ –format=”{date} {type} {owner} {item}#{branch}”

You can see I just modified elements in a couple of branches. I could also list the revs modified on a given branch adding the condition:
and branch=’br:/main/FixBL063/SCM2199’ to the previous query, as you can see in the screenshot.

You can learn more about the available objects to search typing: cm showfindobjects. Currently you can search revisions, branches, changesets, links, revisions and users.

For example, typing “cm find user” you will retrieve a list of the users with objects inside the system.

A list of changesets can also be easily retrieved with:
$ cm find changeset where owner='pablo' and date ">" '2007/08/01'

Now imagine you want to know all the branches you’ve created so far: it can be done with

$ cm find branch where owner=’pablo’, in my case.

Ok, this looks good to monitor somehow what’s going on in the project, which changes someone has done, and so on. But, what about retrieving some statistics?

One of the nice things about cm find is that you can create output in XML format. Try something like:

$ cm find revs where date ">" '2007/08/1' --xml --file=statsAgo.xml

to create a file with all the information about revisions created since a given date. Once you have the XML file you can start playing around with it with your favorite tool.

I imported the data generated by cm find into Excel 2007 and then I started playing with the pivot tables. In the new 2007 release this feature is a little bit hidden: now it is under the insert menu instead of the data menu.

Well, once you create a pivot table out of the imported data you can start grouping it. Then you can show the revisions grouped by branch, including cool graphics.

Show the revisions grouped by user.

Or even calculate the how the revision creation is distributed hourly (you can discover interesting things doing that).

Or weekly:

We’re working on extending the query system to provide an easy (and powerful) way to locate merges, for instance. Also a subsystem we call “advanced query system” is already out (although not officially, it will be in the upcoming BL63.3) which allows directly looking into the relational schema.

Taking the query system as the starting point a new Plastic module will be implemented (this is not yet started) to provide this kind of graphics I showed you but being directly calculated by the GUI tool.

Hope you liked it!
Pablo Santos
I'm the CTO and Founder at Códice.
I've been leading Plastic SCM since 2005. My passion is helping teams work better through version control.
I had the opportunity to see teams from many different industries at work while I helped them improving their version control practices.
I really enjoy teaching (I've been a University professor for 6+ years) and sharing my experience in talks and articles.
And I love simple code. You can reach me at @psluaces.

0 comentarios: