You can clone with
HTTPS or Subversion.
Ideally all symbolizers should produce not an array of objects, but a group with them. An outstanding case is TextSymbolyzer: it produces a lot of individual letters and paths for halo. I had to write a script to group those, but it would be nice if mapnik did it.
The problem is that mapnik currently outputs SVG via cairo, and cairo has no support for grouping so there is not much mapnik can do.
When the native SVG renderer is complete no doubt it will do what you want.
So #1917 does not actually work?
It probably does, yes, but that is using the native svg renderer which, as I understand it, is not complete yet and might not therefore be able to render everything that the agg and cairo renderers can.
Is it possible to include some markers in exported SVG objects that indicate symbolizers (and hopefully layers) those objects are on? E.g. symbolizer="t1231", or as id? This would allow for easier postprocessing, maybe with grouping.
Yes, <g id="layer name"> is done in the native svg_renderer if I recall correctly. Its also easy to extend. I recommend you try it out. The limitations are that it does not yet support text and is not bound from python (so you have to currently write a bit of c++ to access it). But otherwise works well and has promise.
<g id="layer name">
patch to support text at https://gist.github.com/springmeyer/2778d7c64b301c9e2aa5. Just needs updated to latest master.
enable native svg rendering with 'svg-ng' format in render_to_file refs