Submitting a Patch

Coding Guidelines

If you are submitting code, please have a look at the Coding Guidelines page .

Please keep some things in mind when preparing your patches for submission:

  • use one patch per logical change
  • test all coding changes
    • If it is a change to the build system, make sure that the test/ script still works.
  • include some commentary above your patch in your email
  • when mailing patches, try to keep one patch per email
  • do not cut and paste patches... either read them in directly to your mail body (preferred), or send as an attachment
  • add a [PATCH] prefix to your subject line

Why Submit Patches?

Submitting your changes via patch is a good thing. It may seem like an extra bit of work to create a patch and post it to the mailing list, or to make your work available in a public git repo, but there are good reasons why Open Source works that way:

  • Patches tell the maintainer that you want your change to be added to the tree. It is often too easy for busy programmers to misunderstand someone's intentions if they just send a random file. If intentions are not clear, work gets dropped on the floor.
  • Patches show that you have worked with the source code, and hopefully have tested your change.
  • Patches show that you have given some thought to where your changes should go in the tree.
  • Patches to a public mailing list encourage peer review, and show that you are ok with your code being included in a public project.
  • Patches to a public mailing list or a public repository become part of history, showing who did what, and when.
  • Patches usually get top priority from developers.
  • Patches make life easier for the developers, freeing up their time for more features and bug fixes.
  • Patches turn you into a developer. Your name can be added to the AUTHORS file.

Generating Patches

Generating patches depends on the method you used to get the source code.

  • If you are using a tarball, expand the tarball once into a pristine directory, and again into your "working directory." When you are finished and ready to patch, do:
            cd barry-work
            ./ cleanall
            cd ..
            diff -ruN barry-orig barry-work > patchfile
  • If you are using the git tree, you can make your changes in your own branch, and then create patches for each commit you've made:
            cd barry-git
            git format-patch origin/master

Methods for Submitting Patches

Submitting changes can happen in one of three methods:

  • Send a patch to the mailing list.
  • Publish your own git repository (perhaps by creating a forked tree on and notify the mailing list, indicating the branch you want people to pull from when you're ready.
  • Use the "mob" branch on Barry's git repository, and.... send a notification to the mailing list.

Creating a Forked Tree on

The git repo site lets anyone create a forked tree based off the official Barry repo. This saves space on, and adds your fork to a list at the bottom of the official Barry page.

This way, users and developers can look at everyone's changes and test and mix them as needed.

To create a forked tree, visit the Barry repo and click "fork" at the top.

Using the Mob Branch

The public git repository service at provides an interesting feature, which allows anyone to push to a "mob" branch of a repository, if so configured by the admin.

It would go something like this:

        # clone with mob user
        git clone git+ssh:// barry

        cd barry
        git checkout -b mob origin/mob
        git diff origin/master..mob             # make sure master == mob
        <make changes>
        git add ... && git commit
        git push origin mob
        <send email to the list, include the SHA1 sum of the commit>

This is a novel idea, as well as a security risk for anyone who blindly runs whatever is in the mob branch. Hence the recommended diff check above, to make sure you're working on an official branch.

The mob user can only push to the mob branch, so all other branches are read-only, and have been reviewed at least once by the project maintainer.

But the mob branch frees people up to use git, who may not have their own hosting, or who may not want to bother setting up their own git repo. People can use it to collaborate on a feature as well. Let your imagination run wild.

You can read more about the ideas behind the mob branch at the mob page