all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bernhard Herzog <bh@intevation.de>
To: emacs-devel@gnu.org
Subject: diff-hunk-header-re-unified does not match all hunks
Date: Thu, 24 Apr 2008 11:52:01 +0200	[thread overview]
Message-ID: <s9ziqy7bmwu.fsf@thoe.hq.intevation.de> (raw)


diff-mode.el in CVS HEAD has an incorrect value for
diff-hunk-header-re-unified:

(defconst diff-hunk-header-re-unified
  "^@@ -\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)? \\+\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\) @@")

There should be a '?' after the last group:

"^@@ -\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)? \\+\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)? @@"

As is, diff mode cannot deal properly with diffs like this:

diff -ruN origdir/newfile newdir/newfile
--- origdir/newfile	1970-01-01 01:00:00.000000000 +0100
+++ newdir/newfile	2008-04-24 10:47:53.661124659 +0200
@@ -0,0 +1 @@
+new file with a single line
diff -ruN origdir/some-file newdir/some-file
--- origdir/some-file	2008-04-24 10:54:52.930269418 +0200
+++ newdir/some-file	2008-04-24 10:55:12.147053567 +0200
@@ -1 +1 @@
-`Twas brillig, and the slithy toves
+did gyre and gimble in the wabe:


Navigating with diff-file-prev or diff-file-next does not find these
hunks.

   Bernhard

-- 
Bernhard Herzog                              Intevation GmbH, Osnabrück
Amtsgericht Osnabrück, HR B 18998             http://www.intevation.de/
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner




             reply	other threads:[~2008-04-24  9:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24  9:52 Bernhard Herzog [this message]
2008-04-25  2:15 ` diff-hunk-header-re-unified does not match all hunks Stefan Monnier

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s9ziqy7bmwu.fsf@thoe.hq.intevation.de \
    --to=bh@intevation.de \
    --cc=emacs-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.