WebIToo

Wednesday, August 15 2007

Ignoring undesired files in subversion

Good web development practices includes versionning your source code, to be able to rapidly track new appearing bugs and efficiently share work on same source code between more than one people (In fact i use it also for personnal projects, that only involves one developper).

Basic usage is pretty straightforward, and the Subversion Book (see related links) will get you started pretty fast (it took me about an afternoon to read the basic chapters, install subversion, set up svnserve not to give my code to anybody requesting it, installing trac (web interface/wiki/ticket/timeline frontend to svn) and learning the basics to import/checkout/update/revert/resolve stuff in a svn tree.

Recently, some new problem came to me, and I was glad to see that it was not a problem at all because of subversion properties. Properties are text values you set on a svn versionned folder that can have a special meaning. For example, svn:externals property allows you to use another project as a subpart of your tree, very handy in case of plugins, or dependencies for example.

But todays property that interests us is svn:ignore. Pretty self explaining, it allows you to ignore some files, or file patterns, when commiting your changes. Why? Imagine python development, where .pyc (python compiled) files arise everywhere you run .py (python source) files... Ignoring *.pyc would be usefull, don't you think? Ok, you do not write python, so what? Imagine a cache system... Or a website logs... The interest is the same, you'd like to simply ignore the cache, or log folder from svn status or svn commit, thoose folders are usefull but versionning them is very questionable, if not complete nonsense.

So here is how to proceed. The svn commands we're going to use are propset, propget, propedit and propget.

svn propset svn:ignore <mask> <dir> <path> svn propset svn:ignore <dir> <path>

Once set, you can simply propedit it, with your favorite text editor (set SVN_EDITOR, or EDITOR environment variable to the one you like):

svn propedit svn:ignore <path>

To look at the current value of the property:

svn propget svn:ignore <path>

Related links:

Monday, February 19 2007

Symfony 1.0 is out!

Despite the DIGG side effects of which symfony project server suffered because of heavy traffic brought by the well known social bookmarking site's homepage anouncing symfony's first "stable" release, the long awaited 1.0 version is here!

For thoose who don't know it, Symfony is a MVC (Model-View-Component) PHP5 framework aiming to Rapid Application Development and good codinig practices like the DRY (Don't Repeat Yourself) principle. Their main contributors, french developpers from Sensio Labs Fabien Potencier and François Zaninotto have written a very good documentation book about it, that you can either buy at amazon (for thoose who like holding a real book), or download/read freely on the symfony project website as a PDF file.

Supported by a large community, you'll find support about symfony in diverse flavour, from the symfony forum to different languages mailing lists, going thru #symfony and #symfony-fr (for french developpers) on Freenode IRC network.

As the official release note is saying: At last, the long-awaited 1.0 stable version of symfony is just released. For all those who waited for the "stable" status to dive into symfony, the time has come.

Some reference sites about symfony: