Wikia

Vim Tips Wiki

How to make and submit a patch

Talk0
1,613pages on
this wiki
Revision as of 02:04, July 28, 2008 by JLittle (Talk | contribs)

Tip 618 Printable Monobook Previous Next

created December 12, 2003 · complexity basic · author Benji Fisher · version 5.7


Here is how to make a patch. Make a local copy of the file you are going to change, and edit it. Then, change to the directory (such as vim71/) containing the src/ source directory. If you are editing one of the help files and do not have the Vim source files, change to your $VIMRUNTIME directory (usually /usr/local/share/vim/vimxx/ on *nix systems). Use the diff program to make the patch like this:

$ diff -c src/eval.c path/to/my/eval.c > /tmp/eval.c.diff

for a patch to the source or (assuming you do not have the sources)

$ diff -c doc/help.txt path/to/my/help.txt > /tmp/help.txt.diff

The directory and file name for the patches are just suggestions. If you change more than one file, you can concatenate the patches or read the man page for diff to create one big patch.

If you are on a Windows system that does not have the diff program, you may be able to get one from http://gnuwin32.sourceforge.net/

The -c option produces a "context diff". This is fairly easy for both humans and machines to read, and all official patches for Vim are released in this form.

Once you have your patch, you can submit it to the vim-dev mailing list: :help vim-dev See http://www.vim.org/maillist.php#vim-dev

Comments

I had real trouble applying big 'cvs diff' patches, and found the following gnu doc tools and doc useful:

http://www.gnu.org/software/diffutils/diffutils.html


Around Wikia's network

Random Wiki