Guidelines for GStreamer developers with CVS commit access
This is a draft and by no means complete. In fact, it's not even a draft, it's just a bunch of bullet points.
This document is no longer relevant, as we have moved to Git. Check out GitDeveloperGuidelines for the latest and greatest guidelines. |
Committing
every commit should be accompanied by a ChangeLog entry in the right format. Meaning: it should contain the date, your name and e-mail address, the files changed, the functions changed, and an explanation of the change. There are tools like moap and prepare-ChangeLog.pl which handle all this for you.
don't commit things that aren't relevant to your change, such as modified .po files, win32/common/config.h etc. If you don't use moap, you should use a tool like cicl to make sure only files mentioned in the ChangeLog are committed.
- don't commit multiple unrelated changes in one go, commit them separately (this is a bit of a gray area, use your judgement)
before committing, make sure the module you are about to commit to isn't frozen for commits due to a release being prepared. You are expected to check the #gstreamer IRC channel topic and the mailing list for this. If you haven't checked, don't commit. Check the ReleasePlanning page for when to expect releases.
before committing, review what you are about to commit using moap cl diff or diffcl
Committing changes that deprecate API
see DeprecatingAPI for details
Adding new API
New API covers things such as:
- new exported functions which are added to an installed header file (mostly core, -base and -gl libraries)
- new enums or flags in installed header files (mostly core, -base and -gl libraries)
- new GObject properties on core library or plugins library objects, or elements in -base, -good or -ugly
- new structure members in installed header files (mostly core, -base and -gl libraries; plugin/element headers are usually not installed, so you can change those as much as you like)
- new plugins/elements being added to GStreamer core, -base, -good, or -ugly
- basically most things which we can't easily change without breaking things once they've been in a release
Generally, new API should be reviewed before being committed, especially new core or core/-base libs API (in practice you'll find that there is a bit of a gray area here and the rule does not always apply to module maintainers or lead developers).
Getting your new API reviewed is best done by filing an enhancement bug against the module in question and attaching a patch which adds the new API and includes a gtk-doc blurb (don't forget the 'Since: 0.10.x' at the end of the gtk-doc blurb and adding your new function to the appropriate -sections.txt file in the docs/ directory). Mark the bug summary with the [API] keyword for extra attention. Then either wait until you get feedback, or poke people on IRC to have a look at it. If you don't get feedback, keep poking. Don't assume it's ok to commit just because no one raised any objections.
Some simple unit tests for the new API are always a good thing too.
Adding properties
If you're adding new properties, please add a gtk-doc chunk with a 'Since:' tag for the property, e.g.
/**
* GstPipeline:delay
*
* The expected delay needed for elements to spin up to the
* PLAYING state expressed in nanoseconds.
* see gst_pipeline_set_delay() for more information on this option.
*
* Since: 0.10.5
**/
g_object_class_install_property (gobject_class, PROP_DELAY,
g_param_spec_uint64 ("delay", "Delay",
"Expected delay needed for elements "
"to spin up to PLAYING in nanoseconds", 0, G_MAXUINT64, DEFAULT_DELAY,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
Committing new API
Use the 'API:' keyword in the ChangeLog when adding new API (ie. exported functions, GObject vfuncs, GObject properties or GObject signals), e.g.:
2010-10-10 You <you@youdot.com>
* gst/gstutils.c: (gst_utils_foo)
* gst/gstutils.h:
API: gst_utils_foo()or
2010-10-10 You <you@youdot.com>
* plugins/elements/gstfakesrc.c: (gst_fake_src_class_init),
(gst_fake_src_init), (gst_fake_src_set_property),
(gst_fake_src_get_property), (gst_fake_src_start):
* plugins/elements/gstfakesrc.h:
Added format property to control the format of the newsegment events.
API: GstFakeSrc:format(There is not exact format, just make sure to use the keyword)
Tools
moap: maintainer of a project
Tries, among other things, to unify things like prepare-ChangeLog.pl and cicl in one single program and interface, and to make it work for all the different revision control systems out there (CVS, SVN, git, etc.).
Homepage: https://thomas.apestaart.org/moap/trac
Checkout: svn co http://thomas.apestaart.org/moap/svn/trunk moap
moap is still a bit fiddly to set up, and could use some changes to make the ChangeLog output with exuberant-ctags look decent, but it's nice to work with once you've set it up right. The typical workflow would be:
Create a ChangeLog entry with all changes: $ moap cl prep Updating ChangeLog from CVS repository. Finding changes. Extracting affected tags from source. Editing ChangeLog. Trim the ChangeLog entry to what you want to commit, and add explanation of the changes: $ vim ChangeLog Double-check the changes to commit: $ moap cl diff | more Finally, commit: $ moap cl ci
old skool: prepare-ChangeLog.pl, diffcl, cicl
There are multiple versions of the prepare-ChangeLog.pl script and the cicl script around, some with support for different revision control systems and the like. Here is one version of these scripts:
diffcl: shows what would be committed to CVS with cicl
cicl: commit files to CVS based on latest ChangeLog entry
prepare-ChangeLog.pl: prepare-ChangeLog.pl for CVS
setting up your name and e-mail address
Both of these tools expect you to set your CHANGE_LOG_EMAIL_ADDRESS and CHANGE_LOG_NAME environment variable to your e-mail address and name respectively. You can do that by adding something like this to either your ~/.bashrc or ~/.bash_profile file:
# for prepare-ChangeLog.pl and moap cl prep export CHANGE_LOG_EMAIL_ADDRESS="macgyver at somedomain dot com" export CHANGE_LOG_NAME="John MacGyver "
Random notes
don't #include <stdint.h>, use #include "_stdint.h" or #include <_stdint.h>
in Makefile.am, the order of the various CFLAGS and LIBS arguments matters, e.g. it should be $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(LIBFOO_CFLAGS)

