From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72556: 29.1.90; vc-diff does not undo hunk in end of source file Date: Sat, 17 Aug 2024 12:38:19 +0300 Message-ID: <86ttfj32wk.fsf@gnu.org> References: <87ttfs60ir.fsf@posteo.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3904"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72556@debbugs.gnu.org To: Tomas Nordin , Juri Linkov , Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 17 11:39:35 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sfFuI-0000q6-CV for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Aug 2024 11:39:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sfFu8-0000Az-VB; Sat, 17 Aug 2024 05:39:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sfFu7-0000AI-EY for bug-gnu-emacs@gnu.org; Sat, 17 Aug 2024 05:39:23 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sfFu7-0005YQ-4T for bug-gnu-emacs@gnu.org; Sat, 17 Aug 2024 05:39:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=oSf39bR6cTBFW3DQfiC7qHCmGW2dVjkuyONcTuCALV4=; b=QcBiA3n32BY1jYEbw8qQN9d2QR1KVYSifl/HkqvHYwJ2i8NazDq78qiiQm1yGrL6AaWvC2mWPGv0OiWOLTMrZZM37ojilPVMueXHjrL6oIig6LSL9lC8fdnPwOVGkzo9spj9HArqtQu+0382xsYfkWZjviB8n/KNwJohYWOKDbgAgCAkvqjdVvLGDETiXkJTc8NR8++j6K5fqItRyMppVDu16KSXJCI08ZfrJwbjFRMhDAptVLukYtnEs9fPJqzgCqJNwaVAu1wuaParHR6knunaDmAizKGSwKWRRxMBhSZ7omeBzUBVJqLK9kSlN2oFYBysOEtpZHZm1Zz/IaxqQA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sfFuj-0002t5-R4 for bug-gnu-emacs@gnu.org; Sat, 17 Aug 2024 05:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Aug 2024 09:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72556 X-GNU-PR-Package: emacs Original-Received: via spool by 72556-submit@debbugs.gnu.org id=B72556.172388757311053 (code B ref 72556); Sat, 17 Aug 2024 09:40:01 +0000 Original-Received: (at 72556) by debbugs.gnu.org; 17 Aug 2024 09:39:33 +0000 Original-Received: from localhost ([127.0.0.1]:53537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfFuG-0002sD-Lr for submit@debbugs.gnu.org; Sat, 17 Aug 2024 05:39:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfFuD-0002rv-J2 for 72556@debbugs.gnu.org; Sat, 17 Aug 2024 05:39:30 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sfFtR-0005VL-9n; Sat, 17 Aug 2024 05:38:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=oSf39bR6cTBFW3DQfiC7qHCmGW2dVjkuyONcTuCALV4=; b=ASPZeWu1YJd4 yinVuS3PswYxUG0LKffMRIM2QwtRgbvmTGxoTT6azZIcqiigOC7KDrispmP48E4SHY4alE0vfnfgg CeqqLd2GNKnyphatwByMnrr53DKeUi2aJvBeEHhpTxboiOECsierztRzz/6VQB2FTpNHnqg6IT5NP ZMO5iDA/BQNspoDuClLBmH/pE5FQrF8E9vExf/OqDumLvEe8wDLmKt8uNzOB0yt5OC5GDH7l8QaMq 6i6Yw+UIiyAnflwKb7JQYppvyfrOiHKHTWFL7wdHpoC6FK44Kg7wsybQ82ZhT+mZyMsVb4+ujCBnp aFguD4DVCTg17sYlhzyKTw==; In-Reply-To: <87ttfs60ir.fsf@posteo.net> (message from Tomas Nordin on Sat, 10 Aug 2024 12:11:08 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290250 Archived-At: > From: Tomas Nordin > Date: Sat, 10 Aug 2024 12:11:08 +0000 > > I have got used to the diff-mode feature of undoing hunks. I have > noticed that if the diff hunk is an addition in the end of the source > file, I dont get the expected question if I want to undo the hunk. > Instead, the hunk is applied again. > > My example is with a git repo, some edits made (and saved to disk) in a > file, and hitting C-x v = to view the diff. Move to one of the hunks. > One can now diff-apply-hunk to reverse the hunk. But if that hunk is the > last thing in the source file, the hunk is applied (again). This is not > what I expect. > > To reproduce: > > $ mkdir apply > $ cd apply > $ echo "first line of code" > example.file > $ git init > $ git add . > $ git commit -m 'init' > $ echo "last line of code" >> example.file > $ emacs -Q example.file > > C-x v = > n > C-c C-a > > The hunk is applied in the source buffer. Juri and Dmitry, any comments or suggestions?