6 We recently switched to git as Version Control System (VCS) so the following information is out-of-date. Look [here](TypicalGitUsage) for further instructions how to get the repository and how to submit patches!
12 Submitting patches (or diffs) is the usual way of contributing code to DragonFly BSD. All submissions to the project should go to the submit mailing list (http://www.dragonflybsd.org/main/forums.cgi). When you submit a patch please include a description of what has been changed.
14 Making patches when you only have a copy of the source
18 Let's say you just installed DragonFly BSD and you notice a problem in /bin/cat. Since you have /usr/src sync'ed with the main CVS repository. You go into /usr/src/bin/cat and make your modifications. But now what? Well here is what you can do. But next time try the procdure in the next section. :-)
22 1. Copy your version of cat into /usr/src/bin/cat.local
24 2. Run cvsup to resync your source tree back to a clean state.
26 3. Then run diff -ru cat cat.local and submit a patch to the mailing list (with a short description on what you did)
30 root# cp -r /usr/src/bin/cat /usr/src/bin/cat.local
34 root# diff -ru cat cat.local > usr.bin.cat.patch
40 ## Making patches when you have a copy of the repository
42 1. Get a copy of the CVS repository
44 2. Check out a copy of the source from that CVS repository
48 4. Generate a patch with cvs diff
56 I use cvsps 1.3.3 to monitor and extract patchsets from the FreeBSD CVS repository. This utility can be found in /usr/pkgsrc/devel/cvsps.
58 Get a copy of both the FreeBSD and DragonFly cvs repositories.
64 I use cvsup and the following two files to obtain a partial copy of the two projects (DragonFly and FreeBSD).
71 *default host=cvsup.dragonflybsd.org
73 *default base=/usr/home/okumoto/Work/make
75 *default prefix=/usr/home/okumoto/Work/make/dfly-cvs
79 *default delete use-rel-suffix
91 *default host=cvsup14.us.FreeBSD.org
93 *default host=cvsup4.us.FreeBSD.org
95 *default base=/usr/home/okumoto/Work/make
97 *default prefix=/usr/home/okumoto/Work/make/fbsd-cvs
101 *default delete use-rel-suffix
106 Execute the following commands
110 % cd /usr/home/okumoto/Work/make
116 % cvsup fbsd-supfile -c fbsd-sup -i src/usr.bin/make
122 % cvsup dfly-supfile -c dfly-sup -i src/usr.bin/make
126 This should result in two small cvs repositories that only contain source for usr.bin/make, and which will update quickly.
128 Create working directories by checking out the utility you want to work on.
132 The cvs program wants to have a CVSROOT directory so we just create an empty directory. You can use the -R option to cvs, but that prevents you from making your own tags, or checking in stuff into your local repository copy.
138 % mkdir -p fbsd-cvs/src/usr.bin/CVSROOT
142 % (cd fbsd-src; cvs -d ${PWD}/fbsd-cvs/src/usr.bin co make)
146 % mkdir -p dfly-cvs/src/usr.bin/CVSROOT
150 % (cd dfly-src; cvs -d ${PWD}/dfly-cvs/src/usr.bin co make)
154 This should result in a check out of the most current version of make from each project.
156 Use cvsps to extract a change log from the cvs working directory
160 Using cvsps you can extract a patch history.
172 ## Patch History Example
174 From change log history extract a patch.
178 % cvsps -s 49-50 > patch-XXX