bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66113: Apply the entire diff buffer


From: Juri Linkov
Subject: bug#66113: Apply the entire diff buffer
Date: Fri, 22 Sep 2023 09:45:32 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

>> +          (t
>> +           (dolist (buf buffers)
>> +             (with-current-buffer buf
>> +               (display-buffer buf)))
>> +           (message "%d hunks failed; no buffers saved" failures)))))
>
> What happens next in this case? How do you undo in the buffers that had the
> patch hunks already applied?

Manually, like in case of ediff-patch-buffer.

> Any change you wanted to work on the idea of the "atomic rollback" as well?

This would be an unreliable feature: in case of diff-apply creates a mess,
such automatic undo can create more mess, because there are many different
strategies to undo the mess such as using undo-auto-amalgamate, or
applying the reverse diff partially, doing more damage in case when
buffers were already modified before diff-apply.

But fortunately the need to undo will be extremely rare, because
when patch hunks are already applied, it reports the failure,
but doesn't modify the source buffer.  Therefore there is
nothing to undo!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]