GNU bug report logs -
#72556
29.1.90; vc-diff does not undo hunk in end of source file
Previous Next
Reported by: Tomas Nordin <tomasn <at> posteo.net>
Date: Sat, 10 Aug 2024 12:12:01 UTC
Severity: normal
Found in version 29.1.90
Done: Dmitry Gutov <dmitry <at> gutov.dev>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Tomas Nordin <tomasn <at> 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?
This bug report was last modified 65 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.