Submit a patch

From VyOS Wiki
Revision as of 00:01, 15 October 2014 by Dmbaturin (talk | contribs) (Created page with "Patches are always welcome. You should follow some procedures and guidelines though. == Before you make a patch == The two main questions that maintainers need to answer ar...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Patches are always welcome.

You should follow some procedures and guidelines though.

Before you make a patch

The two main questions that maintainers need to answer are:

  • What do we need to implement in this release?
  • What we have already implemented in this release?

VyOS is a big system though, and it's impossible to keep all the information in memory. For this reason we use the bugtracker ("issue tracker" would be a better term, but this one stuck) to keep track of it.

To make this approach work, every change must be associated with a bug number.

If there is no bug/enhancement request for the changes you are going to make, you must create one first.

Once there is a bug about it, you should reference in your commit message, as in:

Bug #42: Correct foo handling in bar.

How to make a patch

We only accept patches in git format, because traditional UNIX patch is only good if the code it's going to be applied to doesn't change.

Find the submodule

Our debian packages have the same names as submodules they are built from. Support you want to make a change in the webproxy script.

You can find its package with "dpkg -S":

# dpkg -S /opt/vyatta/sbin/vyatta-update-webproxy.pl 
vyatta-webproxy: /opt/vyatta/sbin/vyatta-update-webproxy.pl

This means it's in vyatta-webproxy submodule, that is, [1].

Clone the submodule

There are two options.

Clone directly:

git clone https://github.com/vyos/vyatta-webproxy.git

Clone as a submodule:

An easier way is to clone the build-iso and do the rest from there:

git clone https://github.com/vyos/build-iso.git
cd build-iso/

# Ensure you are on the correct branch, suppose you want "helium"/1.1.0:
git checkout helium
  1. Clone the submodule:

git submodule update --init pkgs/vyatta-webproxy

  1. Go to the submodule and switch to the correct branch to:

cd pkgs/vyatta-webproxy git checkout helium </pre>

Making a patch

Set your name and email in the git config:

git config user.name "J. Random Hacker"
git config user.email "jrhacker@example.net"

Make your changes and save them. Then do the following for all changes files:

git add myfile

# Or, for a whole dir:
git add somedir/*

Commit the changes:

git commit

Please use meaningful commit descriptions and don't forget to reference the bug number there!

Now submit the patch. If you forked the repo on github, push and make a pull request.

If not, you can export the patch and send it to maintainers@vyos.net or attach to the bug.

git format-patch

# Or, for multiple commits, suppose you made two:
git format-patch -2