help-gnu-emacs
[Top][All Lists]
Advanced

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

How to apply (multi file) patches conveniently


From: Michael Heerdegen
Subject: How to apply (multi file) patches conveniently
Date: Mon, 06 Feb 2017 13:13:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Hi,

I wonder how a convenient way to apply multi-file patches like they are
posted in emacs-devel or emacs-bug looks like.

Most of the time I first save the patch into a file and try to let git
apply it.  I do that with Magit (w w).  But in 50% of the cases I just
get a message like

128 git … am --3way -- /home/micha/isearch.patch
Patch format detection failed.

Though the patch looks normal to me (what could I'm being doing wrong?
in 50% of the cases it works as expected, and I don't see that I'm doing
something differently in these cases).

Since the documentation of git is not really... cool, I tried to find a
reliable tool in `epatch'.  But it's a total mess.  Consider I have a
patch with a skeleton that looks like this:

 doc/misc/cl.texi                     |   4 +-
 etc/NEWS                             |   4 +
 lisp/emacs-lisp/cl-seq.el            | 355 +++++++++++++++++++++--------------
 test/lisp/emacs-lisp/cl-seq-tests.el |  90 +++++++++
 4 files changed, 307 insertions(+), 146 deletions(-)

diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index 8baa0bd88c..6f387f5cbb 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
....

--- a/etc/NEWS
+++ b/etc/NEWS
....

--- a/lisp/emacs-lisp/cl-seq.el
+++ b/lisp/emacs-lisp/cl-seq.el
...

I call `epatch', then I'm asked for a directory to which the multi-file
patch should be applied to.  I'm specifying the name of the root of the
emacs repository, in my case, "/home/micha/software/emacs".

Epatch should be able to DTRT with this information.  But instead, it
apparently searches all files in this directory, for example, it
searches "cl.texi" in "/home/micha/software/emacs/" instead of
"/home/micha/software/emacs/doc/misc/" as expected.  As a result, I'm
prompted once for the location of every single file.  When I happen to
make a typo, like specifying "cl-seq.elc" instead of "cl-seq.el", the
whole session gets worthless and I can start anew from the beginning.

That looks like a bug to me, but why doesn't anyone else complain about
this - am I doing something wrong?


Thanks,

Michael.



reply via email to

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