unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Michael Orlitzky <michael@orlitzky.com>
Cc: 5352@debbugs.gnu.org
Subject: bug#5352: diff-jump-to-old-file inverts hunk application as well
Date: Mon, 09 May 2022 16:32:11 +0200	[thread overview]
Message-ID: <875yme6al0.fsf@gnus.org> (raw)
In-Reply-To: <4B4AAB78.7030102@orlitzky.com> (Michael Orlitzky's message of "Sun, 10 Jan 2010 23:39:20 -0500")

Michael Orlitzky <michael@orlitzky.com> writes:

> The custom diff-jump-to-old-file causes a reversal of the traditional
> diff/patch behavior present in Emacs <= 22. From diff-mode.el, it seems
> sort of intentional that this is the case; nevertheless, the new
> behavior does not strike me as useful. From diff-mode.el:
>
> (defun diff-apply-hunk (&optional reverse)
>   "Apply the current hunk to the source file and go to the next.
>   By default, the new source file is patched, but if the variable
>   `diff-jump-to-old-file' is non-nil, then the old source file is
>   patched instead (some commands, such as `diff-goto-source' can change
>   the value of this variable when given an appropriate prefix argument).
>
> Why should the default be to patch the new file, which is by definition
> already patched? Take for example,

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I think the logic here is when you have a diff that's been partially
applied, so that the "new" file isn't literally the one you've already
applied the patch to.

In that case, you usually want to apply the hunk to the new file, and
not the old one.

In any case, the current behaviour has been in place for a decade, so I
think it's too late to change it now (because that would break things
for people that's used to the direction it works in now).

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2022-05-09 14:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-11  4:39 bug#5352: diff-jump-to-old-file inverts hunk application as well Michael Orlitzky
2022-05-09 14:32 ` Lars Ingebrigtsen [this message]
2022-05-09 16:18   ` Michael Orlitzky

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875yme6al0.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=5352@debbugs.gnu.org \
    --cc=michael@orlitzky.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).