[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to patch diff into source code?

From: Ian Eure
Subject: Re: how to patch diff into source code?
Date: Wed, 21 Jan 2009 14:55:50 -0800

On Jan 20, 2009, at 6:08 PM, Xah Lee wrote:

could anyone help me with a diff/patch question?

i got the following patch:


is it something i did wrong or the patch?

Maybe both, it's hard to tell if that's the patch, or if it's getting mangled because of email.

Generally, you create patches with diff and apply them with patch. E.g.:

$ patch < thepatchfile

You need to make note of the paths in the header, and make sure you:

1. Put the patch in the same relative location as it was generated from, i.e. you can do "ls lisp\textmodes\css-mode.el" and you see the correct file. 2. Pass a prune argument to patch; this strips off the leading part of the path in the patch. So if you were in the `lisp' directory, you'd give it -p1, if you were in `textmodes', you'd give it -p2, and so on.

Alternately, you can place the patch file in the correct location, open it with Emacs, and use C-c C-a (diff-apply-hunk) to apply the changes within Emacs.

 - Ian

reply via email to

[Prev in Thread] Current Thread [Next in Thread]