Archive for June, 2009

Squash and split with git

Tuesday, June 9th, 2009 by atz

I have been doing a lot of piecing out commits to break them into related feature-coherent sets lately, so I thought I’d share the webpage I used as a reference.

Basically the mechanism uses the same git rebase –interactive that you can use to squash commits, but instead opens one for editing mid-rebase.  Then you can revert it, and use git add -p filename for an interactive selection of chunks to leave in or out.  Add some git commit for your new pieces, and then git rebase –continue to finish.

Complete steps here.  The payoff is that git add -p is a great complement to interactive rebase.

Avoiding $sth->finish()

Thursday, June 4th, 2009 by atz

This is a bit technical and arcane, but I want to mention it because I’ve seen a lot of recent patches still using the old style of code calling $sth->finish() explicitly.  I know a lot of the codebase still does this internally, but for Koha such usage is almost always wrong.

If this were just my personal contention, I would couch this in terms of an RFC to deprecate the usage.  But we don’t get a choice here: DBI is telling us “don’t do it”.

Please refer to the DBI perldoc:

The finish method is rarely needed, and frequently overused, but can sometimes be helpful in a few very specific situations to allow the server to free up resources (such as sort buffers).

When all the data has been fetched from a SELECT statement, the driver should automatically call finish for you. So you should not normally need to call it explicitly except when you know that you’ve not fetched all the data from a statement handle. The most common example is when you only want to fetch one row, but in that case the selectrow_* methods are usually better anyway. Adding calls to finish after each fetch loop is a common mistake, don’t do it, it can mask genuine problems like uncaught fetch errors.

That last sentence is the most concrete and important (hence my bolding).  Moral of the story: don’t do it.  Or if you think you have to, at least comment why, like:

$sth->finish();  # FIXME: leaving data unfetched, should rework query

Koha 3.0.2 released

Thursday, June 4th, 2009 by Galen Charlton

Henri-Damien Laurent, Release Maintainer for Koha 3.0, has announced the release of Koha 3.0.2, the second maintenance release of Koha in the 3.0.x series. The release tar file can be downloaded from http://download.koha.org/koha-3.00.02.tar.gz.

From Henri’s announcement:

We are very happy to announce Koha 3.0.2 Stable has been released on
http://download.koha.org/
Its name is koha-3.00.02.tar.gz You can download file and signatures

You can check the integrity of the package; either by verifying the provided
GPG signature (.sig) or by comparing the MD5 checksum:
c3fee4abbb29c88f97a5f7db5fe9eebf koha-3.00.02.tar.gz

I have also tagged this in Git as “version 3.00.02 final”
v3.00.02-final

This release is bugfix only release, and does not include new
features which would require some database changes.
It does add some databases changes though but only to FIX bugs.

The next release scheduled in July will include features which are now
in master but not ported yet to stable because of database change
required. That is to say mainly many content enhancement were not
integrated Librarything, Syndetics, Baker&Taylor, Babeltheque, and
BranchTransferLimits.
But we are willing to make them into the next release which will come
out as soon as possible in July.

Update: BibLibre’s announcement (in French).