Monthly Archives: March 2008

mercurial’s pager

For quiet some while, I play around with distributed version control systems. Particularly GIT. To think outside of the box I, sometimes try out mercurial. Mercurial works like a charm, only the lack of using a pager to display logs or other long output annoyed me. For sure I could define an alias or always pipe the output to a pager, but I looked for a “out-of-the-box” solution, like GIT provides one.

To make a long story short, the latest changesets on mercurial added a pager extension. To enable the pager, just add the following lines to your local .hg/hgrc or to your global .hgrc:

[extensions]
hgext.pager =

By default, the pager extension uses the environment variable $PAGER.

As mercurial want to be more platform independent than GIT, the developers care about not doing too much platform-dependend stuff. Therefore, if you use less(1) as a default pager, the pager will popup always, even for a oneliner. GIT avoids this by defining special less environment variables, which are to specific to be included into mercurial. To fix that behaviour yourself either define the environment variable LESS=’FSRX’ in your .bashrc or override the pager used by mercurial using the folliwng line in your .hgrc:

[pager]
application = LESS=’FSRX’ less

The pager extensions tries to do exactly the same as if the output would be piped on the bash. Therefore you might notice BROKEN PIPE errors, when you quit the pager before mercurial finished to write all the output. If you get annoyed by that error, use the quiet variable to silence it. It is not enabled by default.

[pager]
quiet = True

Browsing long changesets is now joy.

gc-utils v0.0.4 released

Today I released version 0.0.4 of gc-utils. The new version includes various smaller fixes and code cleanup as well as a small test suite. In addition to that, I added the gc-utils(1) command, which is a wrapper around the gc-import(1), gc-update(1), etc scripts.

# gc-update -v
or …
# gc-utils update -v

Typing just gc-utils will show you all available gc-utils commands:

# gc-utils
gc-utils: 0.0.4
available commands
commit (1) – Apply a git commit to a cvs repository
import (1) – Structured import of a CVS repository into GIT
multi-commit (1) – Menu driven commits, diffs and logs between CVS and GIT repositories
update (1) – Update a GIT repository that was imported with gc-import

Also the manpages have a shortcut now:

# gc-utils help import
… manpage for gc-import

The most important change is that gc-utils now stashes your local changes before continueing the update process and rebases the cvs origin on top of your master branch instead of merging it, as merging might result in duplicated commits due to changing authors and timestamps.

Here is a shorted of changes:

  • gc-update: Rebase by default instead of merging the cvs origin
  • gc-update: Stash away local changes before rebasing
  • gc-update: Simplify by removing unecessary parameters
  • tests/: Test suite
  • manpages: Better command description

gc-utils is a small set of bash scripts that wrap git-cvsimport(1) to make importing cvs repositories and exporting commits back into cvs easier. It is licensed under the terms of the MIT/2-Clause BSD license. gc-utils is available at http://git.experimentalworks.net

Setting up an encrypted ZFS with FreeBSD

I usually want to have my disks encrypted. As all my storage servers run on recent FreeBSDs I usually use GEOM ELI, also known as GELI, to encrypt the disks. Geli is pretty straight forward, runs out of the box on FreeBSD and is easy to set up. So when updating my storage by buying two 500GB disks, I wanted to checkout the ZFS implementation on FreeBSD which is available, but still experimental, on FreeBSD 7.0.

What is ZFS?
ZFS is more than just a filesystem. While usually volume manager and filesystems are separated, Sun’s ZFS combines both. It gives you one command to do both, setting up RAID configuration, setting mountpoints and creating filesystems. In addition to that it can address uo 16 Exbibytes. What makes ZFS sexy is that it gives you a very powerful but easy way to set up RAID-0, RAID-1 or RAID-5 (in fact RAID-Z) with just one command. You can also export and import filesystems and creating snapshots, and just move the complete filesystem to another location. Just take a look at the various ZFS related sites about the featureset. Continue reading