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

Re: [PATCH v1 1/2] merge: Add merge.renames config setting

From
Ben Peart <peartben@gmail.com>
Date
Apr 23, 2018, 16:00 UTC
Message-ID
<1fb11850-4c20-5327-a63a-6d1f5aa18ea4@gmail.com>
In-Reply-To
<xmqqwox19ohw.fsf@gitster-ct.c.googlers.com>
On 4/21/2018 12:23 AM, Junio C Hamano wrote:
Show 21 quoted lines
> Elijah Newren <newren@gmail.com> writes:
> 
>>>>> +merge.renames::
>>>>> +       Whether and how Git detects renames.  If set to "false",
>>>>> +       rename detection is disabled. If set to "true", basic rename
>>>>> +       detection is enabled. This is the default.
>>>>
>>>>
>>>> One can already control o->detect_rename via the -Xno-renames and
>>>> -Xfind-renames options.
>> ...
>> Sorry, I think I wasn't being clear.  The documentation for the config
>> options for e.g. diff.renameLimit, fetch.prune, log.abbrevCommit, and
>> merge.ff all mention the equivalent command line parameters.  Your
>> patch doesn't do that for merge.renames, but I think it would be
>> helpful if it did.
> 
> Yes, and if we are adding a new configuration, we should do so in
> such a way that we do not have to come back and extend it when we
> know what the command line option does and the configuration being
> proposed is less capable already.

Between all the different command line options, config settings, merge strategies and the interactions between the diff and merge versions, I was trying to keep things as simple and consistent as possible. To that end 'merge.renames' was modeled after the existing 'diff.renames.'

I wonder if we can just add a
Show 8 quoted lines
> single configuration whose value can be "never" to pretend as if
> "--Xno-renames" were given, and some similarity score like "50" to
> pretend as if "--Xfind-renames=50" were given.
> 
> That is, merge.renames does not have to a simple "yes-no to control
> the --Xno-renames option".  And it would of course be better to
> document it.
> 

With the existing differences in how these options are passed on the command line, I'm hesitant to add yet another pattern in the config settings that combines 'renames' and '--find-renames[=<n>]'.

I _have_ wondered why this all isn't configured via find-renames with find-renames=0 meaning renames=false (instead of mapping 0 to 32K). I think that could have eliminated the need for splitting rename across two different settings (which is what I think you are proposing above). I'd then want the config setting and command line option to be the same syntax and behavior.

Moving the existing settings to this model and updating the config and command line options to be consistent without breaking backwards compatibility is outside the intended scope of this patch.

> I also had to wonder how "merge -s resolve" faired, if the project
> is not interested in renamed paths at all.
> 

To be clear, it isn't that we're not interested in detecting renamed files and paths. We're just opposed to it taking an hour to figure that out!

> Thanks.
> 
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 65 in “add additional config settings for merge”
  1. 0/2 add additional config settings for mergeBen Peart, Apr 20, 2018
  2. 1/2 merge: Add merge.renames config settingBen Peart, Apr 20, 2018
  3. Elijah NewrenApr 20, 2018
  4. Elijah NewrenApr 20, 2018
  5. Ben PeartApr 23, 2018
  6. Ben PeartApr 20, 2018
  7. Elijah NewrenApr 20, 2018
  8. Junio C HamanoApr 21, 2018
  9. Ben PeartApr 23, 2018
  10. Junio C HamanoApr 23, 2018
  11. Johannes SchindelinApr 24, 2018
  12. Elijah NewrenApr 24, 2018
  13. Johannes SchindelinApr 25, 2018
  14. Eckhard MaaßApr 22, 2018
  15. Ben PeartApr 23, 2018
  16. Eckhard MaaßApr 23, 2018
  17. Ben PeartApr 24, 2018
  18. Ben PeartApr 23, 2018
  19. 2/2 merge: Add merge.aggressive config settingBen Peart, Apr 20, 2018
  20. Elijah NewrenApr 20, 2018
  21. Ben PeartApr 24, 2018
  22. Elijah NewrenApr 24, 2018
  23. Junio C HamanoApr 24, 2018
  24. Ben PeartApr 25, 2018
  25. Elijah NewrenApr 20, 2018
  26. Ben PeartApr 20, 2018
  27. 0/2 add additional config settings for mergeBen Peart, Apr 24, 2018
  28. 1/2 merge: Add merge.renames config settingBen Peart, Apr 24, 2018
  29. Elijah NewrenApr 24, 2018
  30. Elijah NewrenApr 24, 2018
  31. Ben PeartApr 24, 2018
  32. Elijah NewrenApr 25, 2018
  33. 2/2 merge: Add merge.aggressive config settingBen Peart, Apr 24, 2018
  34. Junio C HamanoApr 25, 2018
  35. Ben PeartApr 25, 2018
  36. Junio C HamanoApr 26, 2018
  37. 0/3 add merge.renames config settingBen Peart, Apr 26, 2018
  38. 1/3 merge: update documentation for {merge,diff}.renameLimitBen Peart, Apr 26, 2018
  39. Elijah NewrenApr 26, 2018
  40. Jonathan TanApr 26, 2018
  41. 2/3 merge: Add merge.renames config settingBen Peart, Apr 26, 2018
  42. Elijah NewrenApr 26, 2018
  43. Ben PeartApr 27, 2018
  44. Junio C HamanoApr 27, 2018
  45. Elijah NewrenApr 27, 2018
  46. Johannes SchindelinApr 27, 2018
  47. Elijah NewrenApr 27, 2018
  48. Eckhard MaaßApr 27, 2018
  49. Elijah NewrenApr 27, 2018
  50. Eckhard MaaßApr 30, 2018
  51. Elijah NewrenApr 30, 2018
  52. Elijah NewrenApr 27, 2018
  53. Elijah Newren, Apr 27, 2018
  54. Ben PeartApr 30, 2018
  55. Elijah NewrenApr 30, 2018
  56. Ben PeartMay 2, 2018
  57. 3/3 merge: pass aggressive when rename detection is turned offBen Peart, Apr 26, 2018
  58. Elijah NewrenApr 26, 2018
  59. Elijah NewrenApr 26, 2018
  60. 0/3 add additional config settings for mergeBen Peart, May 2, 2018
  61. 1/3 merge: update documentation for {merge,diff}.renameLimitBen Peart, May 2, 2018
  62. 2/3 merge: Add merge.renames config settingBen Peart, May 2, 2018
  63. Junio C HamanoMay 4, 2018
  64. 3/3 merge: pass aggressive when rename detection is turned offBen Peart, May 2, 2018
  65. Elijah NewrenMay 2, 2018

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.