From unknown Sun Jun 22 07:34:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11894: 24.1.50; [PATCH] diff-apply-hunk can be off by 1 line when the hunk is 0-context pure removal Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Jul 2012 01:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11894 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 11894@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.134188514716870 (code B ref -1); Tue, 10 Jul 2012 01:53:01 +0000 Received: (at submit) by debbugs.gnu.org; 10 Jul 2012 01:52:27 +0000 Received: from localhost ([127.0.0.1]:58850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SoPco-0004O2-Ln for submit@debbugs.gnu.org; Mon, 09 Jul 2012 21:52:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36144) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SoPck-0004Nt-2d for submit@debbugs.gnu.org; Mon, 09 Jul 2012 21:52:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoPXa-0001Sl-Ca for submit@debbugs.gnu.org; Mon, 09 Jul 2012 21:47:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:54975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoPXa-0001Sh-4S for submit@debbugs.gnu.org; Mon, 09 Jul 2012 21:47:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoPXY-0000rI-CA for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2012 21:47:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoPXW-0001SV-EY for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2012 21:46:59 -0400 Received: from forward14.mail.yandex.net ([95.108.130.92]:58906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoPXV-0001SM-R3 for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2012 21:46:58 -0400 Received: from smtp11.mail.yandex.net (smtp11.mail.yandex.net [95.108.130.67]) by forward14.mail.yandex.net (Yandex) with ESMTP id A8EC41980B44 for ; Tue, 10 Jul 2012 05:46:54 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1341884814; bh=nklK6XBVSwvSUV/3QWad9YBl/80PX4833Loz/wN+Cdg=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type; b=bBE5yEo0LDcMDj3AGdCrwRgSlxdV9RKVrwcnLZIaSye6+AwCIu+lZ/A/Xbeqxxo3P XXk5m9w46NUbC/h2fwfSZss6j7rYfrDJu/Lu0uOtUj3FBA65++nSrwCF11h7r+9bPa th7qH/x6QEtUPSe2ILFNzKsoevEI04jg2xxsRbSs= Received: from smtp11.mail.yandex.net (localhost [127.0.0.1]) by smtp11.mail.yandex.net (Yandex) with ESMTP id 95AED7E0482 for ; Tue, 10 Jul 2012 05:46:54 +0400 (MSK) Received: from 98-87.nwlink.spb.ru (98-87.nwlink.spb.ru [178.252.98.87]) by smtp11.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ksVijqW3-ksV8YAKK; Tue, 10 Jul 2012 05:46:54 +0400 X-Yandex-Rcpt-Suid: bug-gnu-emacs@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1341884814; bh=nklK6XBVSwvSUV/3QWad9YBl/80PX4833Loz/wN+Cdg=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type; b=WfXBfrOThXWCKqW/kVoDPOIWC6+l9hZndo852aYQL6P/Mi/c2fJbR+hl6KRZHlORN hF0GIZzHl9uXiGUWy2o/kKKF1UuYU03ienQBV4qXnCuOM0n3vuBOCjiFtBRZbwtIC8 o0msw7fKh7Bmgr3/OH907E21CBHSAzPZKLMptdxY= Message-ID: <4FFB897D.7080303@yandex.ru> Date: Tue, 10 Jul 2012 05:46:37 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080900000409000605040806" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) This is a multi-part message in MIME format. --------------080900000409000605040806 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This applies both to context and unified diffs. To get a 0-context hunk, you invoke diff command with -c0 or -U0 argument. 1. Example files (4 and 3 lines long): test: z abc def test2: z abc def 2. Run `diff -c0 test test2 > test.diff`: *** test 2012-07-09 06:04:04.572209000 +0400 --- test2 2012-07-09 06:04:11.987150600 +0400 *************** *** 3 **** - --- 2 ---- 3. Open test.diff in Emacs, then: a) Do `C-u C-c C-a' (reverse hunk) -> see the empty line appear after "z", instead of after "abc". b) Open test2, add empty line after "abc", go to test.diff window, do `C-c C-a' (apply hunk), see the newline between "z" and "abc" disappear instead. Not sure if we can rely on the line number being always off by 1 in such hunks (there's no insertion, so, technically, the second line number in the header could be arbitrary), but at least 3 versions of diff across 2 different OSes work the same in this regard. Note that if you try to create such hunk with `diff-split-hunk' (by slicing it off a bigger hunk), the line number won't be off by 1. Maybe that's a bug in `diff-split-hunk'. --Dmitry --------------080900000409000605040806 Content-Type: text/plain; charset=windows-1251; name="diff-mode.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="diff-mode.diff" diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 9034ffe..e27b60f 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -1675,7 +1675,11 @@ NOPROMPT, if non-nil, means not to prompt the user." (when (> (prefix-numeric-value other-file) 8) (setq diff-jump-to-old-file other)) (with-current-buffer buf - (goto-char (point-min)) (forward-line (1- (string-to-number line))) + (let ((line-num (string-to-number line))) + ;; When the hunk is pure deletion, line number is off by 1. + (when (string= (if reverse (car old) (car new)) "") + (incf line-num)) + (goto-char (point-min)) (forward-line (1- line-num))) (let* ((orig-pos (point)) (switched nil) ;; FIXME: Check for case where both OLD and NEW are found. --------------080900000409000605040806-- From unknown Sun Jun 22 07:34:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11894: 24.1.50; [PATCH] diff-apply-hunk can be off by 1 line when the hunk is 0-context pure removal Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Jul 2012 13:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11894 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov Cc: 11894@debbugs.gnu.org Received: via spool by 11894-submit@debbugs.gnu.org id=B11894.13426163682148 (code B ref 11894); Wed, 18 Jul 2012 13:00:02 +0000 Received: (at 11894) by debbugs.gnu.org; 18 Jul 2012 12:59:28 +0000 Received: from localhost ([127.0.0.1]:47700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrTqh-0000Ya-TP for submit@debbugs.gnu.org; Wed, 18 Jul 2012 08:59:28 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:46537) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrTqe-0000YS-Pw for 11894@debbugs.gnu.org; Wed, 18 Jul 2012 08:59:25 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q6ICrHAN023960; Wed, 18 Jul 2012 08:53:17 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 39003AECAF; Wed, 18 Jul 2012 08:53:15 -0400 (EDT) From: Stefan Monnier Message-ID: References: <4FFB897D.7080303@yandex.ru> Date: Wed, 18 Jul 2012 08:53:15 -0400 In-Reply-To: <4FFB897D.7080303@yandex.ru> (Dmitry Gutov's message of "Tue, 10 Jul 2012 05:46:37 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4282=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4282> : streams <786686> : uri <1168460> X-Spam-Score: -3.5 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) > Not sure if we can rely on the line number being always off by 1 in such > hunks (there's no insertion, so, technically, the second line number in the > header could be arbitrary), but at least 3 versions of diff across > 2 different OSes work the same in this regard. This looks like a bug in those versions of diff (not that I know a non-buggy version, tho). Could you report it to GNU diffutils. > Note that if you try to create such hunk with `diff-split-hunk' (by slicing > it off a bigger hunk), the line number won't be off by 1. Oh, right, so there is a "version of diff" that doesn't have this bug ;-) > Maybe that's a bug in `diff-split-hunk'. I doubt it. At least `patch' seems to agree with diff-mode.el: % diff -c0 footest1 footest2 |patch -o footest3 footest1 patching file footest1 patch: **** replacement text or line numbers mangled in hunk at line 8 % > - (goto-char (point-min)) (forward-line (1- (string-to-number line))) > + (let ((line-num (string-to-number line))) > + ;; When the hunk is pure deletion, line number is off by 1. > + (when (string= (if reverse (car old) (car new)) "") > + (incf line-num)) > + (goto-char (point-min)) (forward-line (1- line-num))) Context/unified diffs with 0 context are pretty rare, so I'd rather not work around such a bug if I don't really have to. Stefan From unknown Sun Jun 22 07:34:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11894: 24.1.50; [PATCH] diff-apply-hunk can be off by 1 line when the hunk is 0-context pure removal Resent-From: Andreas Schwab Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Jul 2012 13:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11894 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan Monnier Cc: 11894@debbugs.gnu.org, Dmitry Gutov Received: via spool by 11894-submit@debbugs.gnu.org id=B11894.13426184655376 (code B ref 11894); Wed, 18 Jul 2012 13:35:01 +0000 Received: (at 11894) by debbugs.gnu.org; 18 Jul 2012 13:34:25 +0000 Received: from localhost ([127.0.0.1]:47778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrUOW-0001Of-T2 for submit@debbugs.gnu.org; Wed, 18 Jul 2012 09:34:25 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:39843) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrUOV-0001OW-Hx for 11894@debbugs.gnu.org; Wed, 18 Jul 2012 09:34:24 -0400 Received: from frontend4.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3WcfNb0L1hz3hhbR; Wed, 18 Jul 2012 15:29:47 +0200 (CEST) Received: from igel.home (ppp-93-104-147-56.dynamic.mnet-online.de [93.104.147.56]) by mail.mnet-online.de (Postfix) with ESMTPA id 3WcfLj0QJJzbbfn; Wed, 18 Jul 2012 15:28:13 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id A92A6CA2A5; Wed, 18 Jul 2012 15:28:12 +0200 (CEST) From: Andreas Schwab References: <4FFB897D.7080303@yandex.ru> X-Yow: Were these parsnips CORRECTLY MARINATED in TACO SAUCE? Date: Wed, 18 Jul 2012 15:28:12 +0200 In-Reply-To: (Stefan Monnier's message of "Wed, 18 Jul 2012 08:53:15 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Stefan Monnier writes: > This looks like a bug in those versions of diff (not that I know > a non-buggy version, tho). Maybe, but that's how POSIX wants it: The ending line number of an empty range shall be the number of the preceding line, or 0 if the range is at the start of the file. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From unknown Sun Jun 22 07:34:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11894: 24.1.50; [PATCH] diff-apply-hunk can be off by 1 line when the hunk is 0-context pure removal Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Jul 2012 17:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11894 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan Monnier Cc: 11894@debbugs.gnu.org, Andreas Schwab Received: via spool by 11894-submit@debbugs.gnu.org id=B11894.134263268411168 (code B ref 11894); Wed, 18 Jul 2012 17:32:02 +0000 Received: (at 11894) by debbugs.gnu.org; 18 Jul 2012 17:31:24 +0000 Received: from localhost ([127.0.0.1]:48823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrY5r-0002u5-EA for submit@debbugs.gnu.org; Wed, 18 Jul 2012 13:31:23 -0400 Received: from forward3.mail.yandex.net ([77.88.46.8]:60645) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrY5m-0002tv-4q for 11894@debbugs.gnu.org; Wed, 18 Jul 2012 13:31:21 -0400 Received: from smtp1.mail.yandex.net (smtp1.mail.yandex.net [77.88.46.101]) by forward3.mail.yandex.net (Yandex) with ESMTP id 12389B41059; Wed, 18 Jul 2012 21:25:10 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1342632310; bh=xVBNTdd1jFTfV69eLVhlJhi8PJJbyj2k25d2ZYTbdaU=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=R+NEd26zX70Lb7DT27ALVZOzfdridBL4KvUs20rSxEKLScQT2VIpjV89JhgBVJGXZ 3uhG2iFUeuxhuQQmukTqXmcHMmklj0UrITTyRV26F6cW+33OkFThupgKwtb+IWhjhr 6JQSavwMhoPUoMX2PA+2MEKVoLgtElvHDNYmE2s4= Received: from smtp1.mail.yandex.net (localhost [127.0.0.1]) by smtp1.mail.yandex.net (Yandex) with ESMTP id D52BAAA0317; Wed, 18 Jul 2012 21:25:09 +0400 (MSK) Received: from 98-87.nwlink.spb.ru (98-87.nwlink.spb.ru [178.252.98.87]) by smtp1.mail.yandex.net (nwsmtp/Yandex) with ESMTP id P9AWaONl-P9AWuhZW; Wed, 18 Jul 2012 21:25:09 +0400 X-Yandex-Rcpt-Suid: monnier@IRO.UMontreal.CA X-Yandex-Rcpt-Suid: 11894@debbugs.gnu.org X-Yandex-Rcpt-Suid: schwab@linux-m68k.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1342632309; bh=xVBNTdd1jFTfV69eLVhlJhi8PJJbyj2k25d2ZYTbdaU=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=F3hBFOfPUDC32UbqxsWm8jRAsEx8iGuTS+Wmn3+dVGGW2E0Ygy1cNJ6awjRpaBZqa P/6fLoPLB6HC1eih59YnTk0G8qJvvl/gIvZ3D3QrcwkL0foOAC49GOdAdJf7OdQIqU oCcL8NlD3Rl3DP0+ysaVBWvG1rJjBd0kA6wsua2k= Message-ID: <5006F176.10307@yandex.ru> Date: Wed, 18 Jul 2012 21:25:10 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 References: <4FFB897D.7080303@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 18.07.2012 16:53, Stefan Monnier wrote: >> Not sure if we can rely on the line number being always off by 1 in such >> hunks (there's no insertion, so, technically, the second line number in the >> header could be arbitrary), but at least 3 versions of diff across >> 2 different OSes work the same in this regard. > > This looks like a bug in those versions of diff (not that I know > a non-buggy version, tho). Could you report it to GNU diffutils. As per Andreas' comment, this is probably not a bug. >> Note that if you try to create such hunk with `diff-split-hunk' (by slicing >> it off a bigger hunk), the line number won't be off by 1. > > Oh, right, so there is a "version of diff" that doesn't have this bug ;-) Yep, and I'll use it as a workaround if this bug won't be fixed. >> Maybe that's a bug in `diff-split-hunk'. > > I doubt it. At least `patch' seems to agree with diff-mode.el: > > % diff -c0 footest1 footest2 |patch -o footest3 footest1 > patching file footest1 > patch: **** replacement text or line numbers mangled in hunk at line 8 > % `info diff` says: "For proper operation, `patch' typically needs at least two lines of context.", so this just may be a documented problem nobody cares about. >> - (goto-char (point-min)) (forward-line (1- (string-to-number line))) >> + (let ((line-num (string-to-number line))) >> + ;; When the hunk is pure deletion, line number is off by 1. >> + (when (string= (if reverse (car old) (car new)) "") >> + (incf line-num)) >> + (goto-char (point-min)) (forward-line (1- line-num))) > > Context/unified diffs with 0 context are pretty rare, so I'd rather not > work around such a bug if I don't really have to. I'm fine either way, just wanted to report this. --Dmitry From unknown Sun Jun 22 07:34:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11894: 24.1.50; [PATCH] diff-apply-hunk can be off by 1 line when the hunk is 0-context pure removal Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jul 2012 08:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11894 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Andreas Schwab Cc: 11894@debbugs.gnu.org, Dmitry Gutov Received: via spool by 11894-submit@debbugs.gnu.org id=B11894.13426858998904 (code B ref 11894); Thu, 19 Jul 2012 08:19:02 +0000 Received: (at 11894) by debbugs.gnu.org; 19 Jul 2012 08:18:19 +0000 Received: from localhost ([127.0.0.1]:49491 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrlwA-0002JZ-Rc for submit@debbugs.gnu.org; Thu, 19 Jul 2012 04:18:19 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:59471) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Srlw8-0002JI-0n for 11894@debbugs.gnu.org; Thu, 19 Jul 2012 04:18:16 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q6J8C0eq009001; Thu, 19 Jul 2012 04:12:01 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 213FCAECB6; Thu, 19 Jul 2012 03:58:55 -0400 (EDT) From: Stefan Monnier Message-ID: References: <4FFB897D.7080303@yandex.ru> Date: Thu, 19 Jul 2012 03:58:55 -0400 In-Reply-To: (Andreas Schwab's message of "Wed, 18 Jul 2012 15:28:12 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4283=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4283> : streams <787092> : uri <1169141> X-Spam-Score: -3.5 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) >> This looks like a bug in those versions of diff (not that I know >> a non-buggy version, tho). > Maybe, but that's how POSIX wants it: > The ending line number of an empty range shall be the number of the > preceding line, or 0 if the range is at the start of the file. Hmm... but the number we're talking about is the starting-line-number, isn't it? In any case I think that we're OK in the sense that we're not doing much worse than `patch'. Stefan From unknown Sun Jun 22 07:34:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11894: 24.1.50; [PATCH] diff-apply-hunk can be off by 1 line when the hunk is 0-context pure removal Resent-From: Andreas Schwab Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jul 2012 08:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11894 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan Monnier Cc: 11894@debbugs.gnu.org, Dmitry Gutov Received: via spool by 11894-submit@debbugs.gnu.org id=B11894.134268763514702 (code B ref 11894); Thu, 19 Jul 2012 08:48:02 +0000 Received: (at 11894) by debbugs.gnu.org; 19 Jul 2012 08:47:15 +0000 Received: from localhost ([127.0.0.1]:49514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrmOA-0003p4-7B for submit@debbugs.gnu.org; Thu, 19 Jul 2012 04:47:14 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:38962) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrmO6-0003op-24 for 11894@debbugs.gnu.org; Thu, 19 Jul 2012 04:47:11 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3Wd7yY1gC1z4KK31; Thu, 19 Jul 2012 10:42:29 +0200 (CEST) Received: from igel.home (ppp-88-217-104-196.dynamic.mnet-online.de [88.217.104.196]) by mail.mnet-online.de (Postfix) with ESMTPA id 3Wd7wp1c7Tzbbvc; Thu, 19 Jul 2012 10:40:58 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id CBD42CA2A4; Thu, 19 Jul 2012 10:40:57 +0200 (CEST) From: Andreas Schwab References: <4FFB897D.7080303@yandex.ru> X-Yow: I want to dress you up as TALLULAH BANKHEAD and cover you with VASELINE and WHEAT THINS.. Date: Thu, 19 Jul 2012 10:40:57 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 19 Jul 2012 03:58:55 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Stefan Monnier writes: >>> This looks like a bug in those versions of diff (not that I know >>> a non-buggy version, tho). >> Maybe, but that's how POSIX wants it: > >> The ending line number of an empty range shall be the number of the >> preceding line, or 0 if the range is at the start of the file. > > Hmm... but the number we're talking about is the starting-line-number, > isn't it? There is no starting-line-number. Next, the range of lines in file1 shall be written in the following format if the range contains two or more lines: "*** %d,%d ****\n", , and the following format otherwise: "*** %d ****\n", Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 02 01:53:18 2012 Received: (at control) by debbugs.gnu.org; 2 Dec 2012 06:53:18 +0000 Received: from localhost ([127.0.0.1]:49207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tf3QP-0005ID-JA for submit@debbugs.gnu.org; Sun, 02 Dec 2012 01:53:17 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:50443) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tf3QM-0005I4-Qj for control@debbugs.gnu.org; Sun, 02 Dec 2012 01:53:11 -0500 Received: by mail-pa0-f44.google.com with SMTP id hz11so1144275pad.3 for ; Sat, 01 Dec 2012 22:50:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=qWJBlFeMfE5UM/wyVRCmcxnLcEehtCXgcGQMBX9pa+o=; b=tddQK3v6pAQ3SAJrITMgs7h9Fd/1lLP1w5izZrVP0b4XbPdadivEAYeuqhkhyo41iZ GzDIVOYZgPcfnq4vZH73kCgxU8wwmLRtcDGxhwjwLbtQk6/Ecic7gjbu+RyijkNbqssI IpPwDiKNIM+4TNSpGtlH4Fvunq05yexV5QORy4lUuXYrecvvVk9yIT17EyJjfGfki+GD AB/nL6nso5m9XEmShORErlk86KfWHvm51D2Lc5sqeh9dX57vdNVyO7QkiawnbNP4xz8Y D9OA+LZWIQxMWYV+ivifMjtIT1F6z9hnGvKuq0C3QW7+Xkjvjsne6yQXV/Ygqv5OcR+2 AyKA== Received: by 10.66.87.202 with SMTP id ba10mr16082385pab.72.1354431055001; Sat, 01 Dec 2012 22:50:55 -0800 (PST) Received: from ulysses (cm198.gamma83.maxonline.com.sg. [202.156.83.198]) by mx.google.com with ESMTPS id us7sm5912755pbc.40.2012.12.01.22.50.52 (version=SSLv3 cipher=OTHER); Sat, 01 Dec 2012 22:50:53 -0800 (PST) From: Chong Yidong To: control@debbugs.gnu.org Subject: tags 11894 + wontfix Date: Sun, 02 Dec 2012 14:50:50 +0800 Message-ID: <87obidymk5.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) tags 11894 + wontfix close 11894 thanks