all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tomas Nordin <tomasn@posteo.net>, Juri Linkov <juri@linkov.net>,
	Dmitry Gutov <dmitry@gutov.dev>
Cc: 72556@debbugs.gnu.org
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	[thread overview]
Message-ID: <86ttfj32wk.fsf@gnu.org> (raw)
In-Reply-To: <87ttfs60ir.fsf@posteo.net> (message from Tomas Nordin on Sat, 10 Aug 2024 12:11:08 +0000)

> From: Tomas Nordin <tomasn@posteo.net>
> 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?





  reply	other threads:[~2024-08-17  9:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-10 12:11 bug#72556: 29.1.90; vc-diff does not undo hunk in end of source file Tomas Nordin
2024-08-17  9:38 ` Eli Zaretskii [this message]
2024-08-19 16:49   ` Juri Linkov
2024-08-31  8:09     ` Eli Zaretskii
2024-09-14  7:35       ` Eli Zaretskii
2024-09-14 15:47     ` Dmitry Gutov
2024-09-14 15:50 ` Dmitry Gutov
2024-09-15 10:41   ` Tomas Nordin

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=86ttfj32wk.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=72556@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=juri@linkov.net \
    --cc=tomasn@posteo.net \
    /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.