From: Juri Linkov <juri@jurta.org>
To: kifer@cs.sunysb.edu
Cc: emacs-devel@gnu.org
Subject: Re: Ediff-patch-file with wrong default buffer
Date: Mon, 14 Dec 2009 07:47:36 +0200 [thread overview]
Message-ID: <87ocm2m6v3.fsf@mail.jurta.org> (raw)
In-Reply-To: <20091214004325.61e9afe3@kiferserv> (Michael Kifer's message of "Mon, 14 Dec 2009 00:43:25 -0500")
> 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/
next prev parent reply other threads:[~2009-12-14 5:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-05 23:48 Fix info display of images David Kastrup
2009-12-07 17:55 ` Juri Linkov
2009-12-07 20:28 ` David Kastrup
2009-12-13 11:09 ` David Kastrup
2009-12-13 18:31 ` Juri Linkov
2009-12-14 4:16 ` Chong Yidong
2009-12-14 5:14 ` Ediff-patch-file with wrong default buffer (was: Fix info display of images) Juri Linkov
2009-12-14 5:43 ` Michael Kifer
2009-12-14 5:47 ` Juri Linkov [this message]
2009-12-14 6:15 ` Ediff-patch-file with wrong default buffer Michael Kifer
2009-12-14 6:54 ` Juri Linkov
2010-02-02 0:31 ` Juri Linkov
2010-02-02 2:34 ` Stefan Monnier
2010-02-02 22:38 ` Juri Linkov
2010-02-02 0:33 ` Juri Linkov
2009-12-14 9:35 ` Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ocm2m6v3.fsf@mail.jurta.org \
--to=juri@jurta.org \
--cc=emacs-devel@gnu.org \
--cc=kifer@cs.sunysb.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).