git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Pavel Rappo <pavel.rappo@gmail.com>
Cc: Elijah Newren <newren@gmail.com>, Git mailing list <git@vger.kernel.org>
Subject: Re: How to turn off rename detection for cherry-pick?
Date: Thu, 29 Aug 2024 17:43:36 -0400	[thread overview]
Message-ID: <20240829214336.GA440013@coredump.intra.peff.net> (raw)
In-Reply-To: <CAChcVunYDO_KAmEOoWEL2q63_Gzua-Kt3BmE5Snb8==K9Cww1w@mail.gmail.com>

On Thu, Aug 29, 2024 at 09:47:52AM +0100, Pavel Rappo wrote:

> The reason I ask this is that we've run into a (probably practically
> rare) case where cherry-pick changes a wrong file. We want to be able
> to detect such cases.

You can pass merge strategy options on the command line. The old
"recursive" strategy has a "no-renames" option, so:

  git cherry-pick --strategy=recursive -Xno-renames feature

generates a modify/delete conflict for your example. Curiously, the
modern default, "ort", does not seem to respect that option. You can
bump up the limit to require exact renames, though, which does prevent
the mismerge in your case. Like:

  git cherry-pick -Xfind-renames=100% feature

There are also other strategies that do not do rename detection, but I
think you are better off using one of the more commonly-used strategies
and just disabling renames. IMHO it's a bug that ort doesn't respect
-Xno-renames.

-Peff

  reply	other threads:[~2024-08-29 21:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-26 11:09 How to turn off rename detection for cherry-pick? Pavel Rappo
2024-08-29  8:47 ` Pavel Rappo
2024-08-29 21:43   ` Jeff King [this message]
2024-08-29 23:12     ` Pavel Rappo
2024-08-30  0:31       ` Jeff King
2024-08-30 10:35         ` Pavel Rappo
2024-08-30 14:33         ` Elijah Newren
2024-08-30 16:49           ` Junio C Hamano
2024-08-30 16:14         ` Junio C Hamano
2024-08-30 17:17           ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to=20240829214336.GA440013@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    --cc=pavel.rappo@gmail.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.
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 NNTP newsgroup(s).