emacs-devel
[Top][All Lists]
Advanced

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

Re: Ediff-patch-file with wrong default buffer


From: Juri Linkov
Subject: Re: Ediff-patch-file with wrong default buffer
Date: Mon, 14 Dec 2009 07:47:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (x86_64-pc-linux-gnu)

> So, either the patch that you are referring to broke the above behavior or
> the current buffer does not match ediff-context-diff-label-regexp.

The problem is that the current buffer with a non-CVS patch does not
match ediff-context-diff-label-regexp.  The GNU unified format diff 2-liner
requires whitespace (and a date) after the file name:

(defcustom ediff-context-diff-label-regexp
  (concat "\\("         ; context diff 2-liner
          "^\\*\\*\\* +\\([^ \t]+\\)[^*]+[\t ]*\n--- +\\([^ \t]+\\)"
          "\\|"         ; GNU unified format diff 2-liner
          "^--- +\\([^ \t]+\\)[\t ]+.*\n\\+\\+\\+ +\\([^ \t]+\\)"
Problematic part underlined   ======

but Git produces patches in the format without whitespace and a date after
the name of the first file (on the line that begins with ---), e.g.

--- a/lisp/info.el
+++ b/lisp/info.el

The following patch fixes this problem:

Index: lisp/ediff-ptch.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/ediff-ptch.el,v
retrieving revision 1.47
diff -u -r1.47 ediff-ptch.el
--- lisp/ediff-ptch.el  31 Jan 2009 22:10:29 -0000      1.47
+++ lisp/ediff-ptch.el  14 Dec 2009 05:47:01 -0000
@@ -127,7 +127,7 @@
   (concat "\\("        ; context diff 2-liner
          "^\\*\\*\\* +\\([^ \t]+\\)[^*]+[\t ]*\n--- +\\([^ \t]+\\)"
          "\\|"         ; GNU unified format diff 2-liner
-         "^--- +\\([^ \t]+\\)[\t ]+.*\n\\+\\+\\+ +\\([^ \t]+\\)"
+         "^--- +\\([^ \t]+\\)[\t ]*.*\n\\+\\+\\+ +\\([^ \t]+\\)"
          "\\)")
   "Regexp matching filename 2-liners at the start of each context diff.
 You probably don't want to change that, unless you are using an obscure patch

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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