{"thread":{"id":"63010","subject":"[GSoC][PATCH v4] merge-strategies.adoc: detail submodule merge","startedAt":"2025-02-27T01:44:24Z","lastAt":"2025-02-27T17:50:33Z","messageCount":3,"participants":["Lucas Seiki Oshiro","Elijah Newren","Junio C Hamano"],"isPatch":true,"patchVersion":4,"patchTotal":null},"messages":[{"id":"513132","messageId":"20250227014406.20527-1-lucasseikioshiro@gmail.com","threadId":"63010","inReplyTo":null,"subject":"[GSoC][PATCH v4] merge-strategies.adoc: detail submodule merge","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2025-02-27T01:44:06Z","receivedAt":"2025-02-27T01:44:24Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Submodule merges are, in general, similar to other merges based on oid\nthree-way-merge. When a conflict happens, however, Git has two special\ncases (introduced in 68d03e4a6e44) on handling the conflict before\nyielding it to the user. From the merge-ort and merge-recursive sources:\n\n- \"Case #1: a is contained in b or vice versa\": both strategies try to\nperform a fast-forward in the submodules if the commit referred by the\nconflicted submodule is descendant of another;\n\n- \"Case #2: There are one or more merges that contain a and b in the\nsubmodule.  If there is only one, then present it as a suggestion to the\nuser, but leave it marked unmerged so the user needs to confirm the\nresolution.\"\n\nAdd a small paragraph on merge-strategies.adoc describing this behavior.\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nHelped-by: Elijah Newren <newren@gmail.com>\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n\nJust removing an extra blank line from v3.\n\nDocumentation/merge-strategies.adoc | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/Documentation/merge-strategies.adoc b/Documentation/merge-strategies.adoc\nindex 5fc54ec060..c8d81bcda6 100644\n--- a/Documentation/merge-strategies.adoc\n+++ b/Documentation/merge-strategies.adoc\n@@ -22,6 +22,13 @@ ort::\n \twas written as a replacement for the previous default\n \talgorithm, `recursive`.\n +\n+In the case where the path is a submodule, if the submodule commit used on\n+one side of the merge is a descendant of the submodule commit used on the\n+other side of the merge, Git attempts to fast-forward to the\n+descendant. Otherwise, Git will treat this case as a conflict, suggesting\n+as a resolution a submodule commit that is descendant of the conflicting\n+ones, if one exists.\n++\n The 'ort' strategy can take the following options:\n \n ours;;\n@@ -96,6 +103,9 @@ recursive::\n \tthe default strategy for resolving two heads from Git v0.99.9k\n \tuntil v2.33.0.\n +\n+For a path that is a submodule, the same caution as 'ort' applies to this\n+strategy.\n++\n The 'recursive' strategy takes the same options as 'ort'.  However,\n there are three additional options that 'ort' ignores (not documented\n above) that are potentially useful with the 'recursive' strategy:\n-- \n2.39.5 (Apple Git-154)\n\n"},{"id":"513134","messageId":"CABPp-BGA530spgVtsU2UO7GyVXL2x=R_80n02pMiPCVA+1SgBg@mail.gmail.com","threadId":"63010","inReplyTo":"20250227014406.20527-1-lucasseikioshiro@gmail.com","subject":"Re: [GSoC][PATCH v4] merge-strategies.adoc: detail submodule merge","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2025-02-27T03:26:39Z","receivedAt":"2025-02-27T03:26:51Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Wed, Feb 26, 2025 at 5:44 PM Lucas Seiki Oshiro\n<lucasseikioshiro@gmail.com> wrote:\n>\n> Submodule merges are, in general, similar to other merges based on oid\n> three-way-merge. When a conflict happens, however, Git has two special\n> cases (introduced in 68d03e4a6e44) on handling the conflict before\n> yielding it to the user. From the merge-ort and merge-recursive sources:\n>\n> - \"Case #1: a is contained in b or vice versa\": both strategies try to\n> perform a fast-forward in the submodules if the commit referred by the\n> conflicted submodule is descendant of another;\n>\n> - \"Case #2: There are one or more merges that contain a and b in the\n> submodule.  If there is only one, then present it as a suggestion to the\n> user, but leave it marked unmerged so the user needs to confirm the\n> resolution.\"\n>\n> Add a small paragraph on merge-strategies.adoc describing this behavior.\n>\n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Helped-by: Elijah Newren <newren@gmail.com>\n> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n> ---\n>\n> Just removing an extra blank line from v3.\n>\n> Documentation/merge-strategies.adoc | 10 ++++++++++\n>  1 file changed, 10 insertions(+)\n>\n> diff --git a/Documentation/merge-strategies.adoc b/Documentation/merge-strategies.adoc\n> index 5fc54ec060..c8d81bcda6 100644\n> --- a/Documentation/merge-strategies.adoc\n> +++ b/Documentation/merge-strategies.adoc\n> @@ -22,6 +22,13 @@ ort::\n>         was written as a replacement for the previous default\n>         algorithm, `recursive`.\n>  +\n> +In the case where the path is a submodule, if the submodule commit used on\n> +one side of the merge is a descendant of the submodule commit used on the\n> +other side of the merge, Git attempts to fast-forward to the\n> +descendant. Otherwise, Git will treat this case as a conflict, suggesting\n> +as a resolution a submodule commit that is descendant of the conflicting\n> +ones, if one exists.\n> ++\n>  The 'ort' strategy can take the following options:\n>\n>  ours;;\n> @@ -96,6 +103,9 @@ recursive::\n>         the default strategy for resolving two heads from Git v0.99.9k\n>         until v2.33.0.\n>  +\n> +For a path that is a submodule, the same caution as 'ort' applies to this\n> +strategy.\n> ++\n>  The 'recursive' strategy takes the same options as 'ort'.  However,\n>  there are three additional options that 'ort' ignores (not documented\n>  above) that are potentially useful with the 'recursive' strategy:\n> --\n> 2.39.5 (Apple Git-154)\n\nLooks good to me; thanks!\n"},{"id":"513171","messageId":"xmqqh64f8efs.fsf@gitster.g","threadId":"63010","inReplyTo":"CABPp-BGA530spgVtsU2UO7GyVXL2x=R_80n02pMiPCVA+1SgBg@mail.gmail.com","subject":"Re: [GSoC][PATCH v4] merge-strategies.adoc: detail submodule merge","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-02-27T17:50:31Z","receivedAt":"2025-02-27T17:50:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Elijah Newren <newren@gmail.com> writes:\n\n> Looks good to me; thanks!\n\nThanks, both of you.\n\n"}]}