Wikia

Vim Tips Wiki

Changes: How to make and submit a patch

Edit

Back to page

m (review, remove leading / from src)
(Remove html character entities)
 
Line 11: Line 11:
 
|category2=
 
|category2=
 
}}
 
}}
 
 
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:
 
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:
   
 
<pre>
 
<pre>
$ diff -c src/eval.c path/to/my/eval.c &gt; /tmp/eval.c.diff
+
$ diff -c src/eval.c path/to/my/eval.c > /tmp/eval.c.diff
 
</pre>
 
</pre>
   
Line 21: Line 20:
   
 
<pre>
 
<pre>
$ diff -c doc/help.txt path/to/my/help.txt &gt; /tmp/help.txt.diff
+
$ diff -c doc/help.txt path/to/my/help.txt > /tmp/help.txt.diff
 
</pre>
 
</pre>
   

Latest revision as of 02:51, September 29, 2008

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

CommentsEdit

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