Using Bazaar for Samba Development

From SambaWiki
Jump to: navigation, search

Source Control Options for Samba development

This is a short overview of Samba's source control management systems and is primarily intended for people who want to do Samba development. The primary source control management for Samba is subversion. There are at least four main branches which are under active development.

  • SAMBA_3_0 is the unstable development tree for the Samba 3.0.x release series
  • SAMBA_3_0_X is the stable development tree for the Samba 3.0.x series. Each release will have its own branch. For example, bug fixes for the Samba 3.0.25 release are done in the SAMBA_3_0_25 branch.
  • SAMBA_3_0_RELEASE is the engineering release branch for the current 3.0.x[a-z] release. The release tarballs are cut from this tree.
  • SAMBA_4_0 is the research branch for things such as Active Directory domains, NTVFS, SMB2, and LDB.

The repository and branches is mirrored in three ways:



Anonymous SVN



Using Bazaar with Samba

Bazaar is a distributed SCM which provides an efficient means of developing in a local tree and periodically merging changes from the main Samba tree. More information on Bazaar is available at

Currently the Samba bzr branch mirrors are generated from the svn change sets and creates a fairly large repository once the number of commits climbs into the 4000 range. The major complaints against using bzr for Samba is the time it takes to branch from an http:// URL. To alleviate this, I've placed tarballs of the bzr branches in You can download and extract these and run "bzr pull" to bring the branch up to date. I keep a mirrored version of the SAMBA_3_0 bzr tree locally so I can branch from that (since I branch quite a lot while working on a new feature).

The long term solution will be once the svn plugin is widely available and developers can directly branch bzr trees from the central svn repository. Until then....

Here's a simple example of how to get started using bzr:

0. Install bzr. See details at

1. First download the archived tarball of the branch you desire. You can also verify the MD5 and SHA1 sums of the tarballs in the GnuPG signed SIGNATURES.txt file in the same download directory.

$ mkdir $HOME/bzr && cd $HOME/bzr
$ wget

2. Extract the tarball and update it to the latest source

$ tar jxvf SAMBA_3_2.bzr-svn-r24541.tar.bz2
$ cd SAMBA_3_2.bzr
$ bzr pull --remember

3. Now create a local branch for your changes

$ cd $HOME/bzr
$ bzr branch SAMBA_3_2.bzr samba32-working.bzr

4. Make changes to your local samba32-working.bzr tree.

5. To merge any upstream changes to your local tree you can do one of two things. Either run "bzr pull" on the local mirror you created in Step #2 and merge from there. Or merge directly from the main bzr mirror on In either case you will need to run "bzr merge ${URL}" replacing ${URL} with either the path on disk to your local mirror or the http:// URL to the main Samba bzr mirror.

$ bzr merge

6. Publish your working tree to an apache server for review. There are many ways to publish a tree so I'll defer to the Bazaar wiki rather than repeat it here. Hint: you can use sftp, rsync (over ssh), or just push to another local directory if you have Apache (or some other web server) running on the local box.

Posting Patches

Patches should be posted for review on the samba-technical mailing list. If you are using Bazaar, then please post the URL of your published tree as well. The preferred format is as an attached "diff -u" file. Inline patches munge formatting and are therefore evil. Large patches should be broken into logical chunks. Any patch that contains unnecessary reformatting of code will be ignored.

More information on the developer mailing list can be found at