GNU bug report logs -
#66061
30.0.50; [PATCH] diff-buffer-with-file should reverse the order if the file is modified
Previous Next
Full log
Message #11 received at 66061 <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org>
Date: Mon, 18 Sep 2023 13:47:39 +0300
> From: Bob Rogers <rogers <at> rgrjr.com>
> Date: Sun, 17 Sep 2023 16:54:41 -0700
>
> . . .
>
> The attached patch reverses the order of the arguments to diff only
> when the buffer is unmodified. Either the file has changed on disk, in
> which case it is probably newer, or it hasn't, in which case the diff
> will be empty anyway so the order doesn't matter (and that saves
> checking the actual file mod time).
I don't think we can automatically always reverse them in this case.
Here's a simple case where we shouldn't:
. visit a file
. make some edits
. save the buffer to the file
. copy from the backup file (or some other previous version) over
the edited file on disk
I thought of that, but figured this was a much less likely scenario, and
could be ignored for the sake of getting closer to the right thing.
I think only the user knows what is "old" and what is "new". We
should, of course, allow the user to reverse them, but we shouldn't
reverse automatically.
Fair enough. I suppose M-x diff-reverse-direction is not that much
extra trouble. (I should probably find a keybinding for it.)
-- Bob
This bug report was last modified 1 year and 270 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.