git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Custom merge driver with no rename detection

From
FAFelipe Gonçalves Assis <felipeg.assis@gmail.com>
Date
Feb 16, 2016, 01:04 UTC
Message-ID
<CALMa68o3EsnLaKUmQstkF5KOtiqVkLF4_-Q1eWPyAQQF_adS+Q@mail.gmail.com>
In-Reply-To
<xmqqd1ryqlpr.fsf@gitster.mtv.corp.google.com>
On 15 February 2016 at 09:03, Junio C Hamano <gitster@pobox.com> wrote:
Show 31 quoted lines
> Felipe Gonçalves Assis <felipeg.assis@gmail.com> writes:
>
>> However, if you do find this approach acceptable/desirable
>> (rename-threshold > 100%), I can work on the issues pointed out and
>> propose a proper patch.
>
> The caller asks diffcore-rename to detect rename, and the algorithm
> compares things to come up with a similarity score and match things
> up.  And you add an option to the rename detection logic to forbid
> finding any?
>
> To be bluntly honest, the approach sounds like a crazy talk.
>
> If your goal is not to allow rename detection at all, why not teach
> the caller of the diff machinery not to even ask for rename
> detection at all?  merge-recursive.c has a helper function called
> get_renames(), and it calls into the diff machinery passing
> DIFF_DETECT_RENAME option.  As a dirty hack, I think you would
> achieve your desired result if you stop passing that option there.
>
> I called that a "dirty hack", because for the purpose of not
> allowing rename detection inside merge-recursive, I think an even
> better thing to do is to teach the get_renames() helper to report to
> its caller, under your new option, "I found no renames at all"
> without doing anything.
>
> It might be just a simple matter of teaching its callers (there
> probably are two of them, one between the common ancestor and our
> branch and the other between the common ancestor and their branch)
> not call the get_renames() helper at all under your new option, but
> I didn't check these callers closely.

Thanks for all the ideas. In order to have something concrete to discuss, I submitted the patch "merge-recursive: option to disable renames".

Is that what you had in mind? I would be happy to receive comments and either improve it or try something else.

Felipe
Previous: Junio C Hamano
Message 8 of 8 in “Custom merge driver with no rename detection”
  1. Felipe Gonçalves AssisFeb 14, 2016
  2. Junio C HamanoFeb 15, 2016
  3. Johannes SchindelinFeb 15, 2016
  4. Junio C HamanoFeb 15, 2016
  5. Johannes SchindelinFeb 15, 2016
  6. Felipe Gonçalves AssisFeb 15, 2016
  7. Junio C HamanoFeb 15, 2016
  8. Felipe Gonçalves AssisFeb 16, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.