GNU bug report logs -
#62731
29.0.60; diff-apply-hunk doesn't work for creating new files
Previous Next
Reported by: sbaugh <at> catern.com
Date: Sun, 9 Apr 2023 01:15:02 UTC
Severity: normal
Found in version 29.0.60
Done: Dmitry Gutov <dmitry <at> gutov.dev>
Bug is archived. No further changes may be made.
Full log
Message #46 received at 62731 <at> debbugs.gnu.org (full text, mbox):
>>> Otherwise, I don't quite understand the intent behind that line. But it
>>> might have been masking the problem which I (hopefully) fixed in the
>>> hunk you quoted/
>> There is already one 'xor' here. Maybe the second 'xor' not needed:
>> (defun diff-find-source-location (&optional other-file reverse noprompt)
>> ...
>> (let* ((other (xor other-file diff-jump-to-old-file))
>> ...
>> (file (or (diff-find-file-name (xor other reverse) noprompt)
>
> Yes ok, let's try moving that to the caller. Pushed as commit
> 1374f20491b. A few other callers use non-nil 'reverse', but I suppose
> diff-test-hunk is not very useful for file creation/deletion.
Thanks for fixing, I confirm that now 'C-c C-c' doesn't go to the
backup file, only 'C-u C-c C-c' does.
> Note that the new (same as previous) behavior is to always visit the source
> buffer, newer the backup file's buffer. I hope that is the goal.
I forgot that diff-goto-source is not context-dependent for file diffs,
unlike for vc-diff. So for file diffs it depends only on the prefix arg.
I don't know why is such inconsistency and whether it should be improved.
This bug report was last modified 217 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.