From patchwork Wed Aug 4 05:28:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12417889 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58EAFC432BE for ; Wed, 4 Aug 2021 05:29:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 36E0F60F10 for ; Wed, 4 Aug 2021 05:29:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235321AbhHDF3N (ORCPT ); Wed, 4 Aug 2021 01:29:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235307AbhHDF3M (ORCPT ); Wed, 4 Aug 2021 01:29:12 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDC10C061798 for ; Tue, 3 Aug 2021 22:28:59 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id m20-20020a05600c4f54b029024e75a15716so710590wmq.2 for ; Tue, 03 Aug 2021 22:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=Ozz+Q6jIqdDXWdedQk8pgSDu4NYF2AUR0oe+dc6y6+A=; b=UjdQ+1fLvcXud5SmbqhdxoC6FKH7GU75rbZnqFJXPd88y0GhNOH267N8EhntMHw+DH BGMllIslMrgCVRIURB9mlbTkwWDDk+br1tOnJpF0Lcb7ulb5n2T9BHomLvaBx7DQw0yG S0CeEB+iAfVJsXqNh90guTTJn2seWudRXUxNMhkdtZmB4AsTESQt9FFe/bqWP+M2naYL MKwsDrCAXTPAphFtVhBse0PMzB/O0SCBrHefeJg7JlLvheOHRdjtsv4SG89lE0bSFFZL pTArOHAuD4cw/97IJUp3Xk6NLhiopfNnOpcfAk/GAGHS82Dv+XJSw4E2DkiOx10oy8AF sjhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=Ozz+Q6jIqdDXWdedQk8pgSDu4NYF2AUR0oe+dc6y6+A=; b=fRnenKySHgC6CGl5wiKDeDH3u7/R1+Ime3wc0PoCoZRrceUgC2/1jArryhfpH9dBtk ZG23KBP/l1bK08sdfhaIVgNFDDJ750Q/IQtR/sLpqz0POFB9BtsTgkfwBNDgC/Xh0rGJ Que6yI5iTxPvPSlxo53wGrPMFEokfMAowINz0ua+7V5PRXLSU+2ujNS974nQg91N+emh pc3OKMPPvBO8Efb/2SX+gRg87O9FCjv9r+PS0J2cOGzhBjtQIs1GCPisZW9gf9Y02gr+ JUuxxZ2IqRS0j/EIE5CCuuTKQ4kKx2ZqPuInOQ3IyHnFtBnpYjv5wBccy7X9paOycXeW YQmg== X-Gm-Message-State: AOAM533/u4boMaBQBVcJToa1IR1zjYLfdGgSlGQL23NThYyWATJ9fYUp kSRGidf/dH3c2o+dx4kfH2mZtA2n8/E= X-Google-Smtp-Source: ABdhPJzqyKSnHm7iqbzrTLeE2nvU7+xputvDh8B/zzXzPr9TmRhtqBmBKBqQUlSfKRunurWbcBUYAQ== X-Received: by 2002:a05:600c:35d6:: with SMTP id r22mr7697234wmq.41.1628054938440; Tue, 03 Aug 2021 22:28:58 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id h16sm1071359wre.52.2021.08.03.22.28.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 22:28:58 -0700 (PDT) Message-Id: <3435239716822c0ce01232d06bc9f0170fb2f946.1628054936.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Wed, 04 Aug 2021 05:28:46 +0000 Subject: [PATCH v2 01/10] git-rebase.txt: correct antiquated claims about --rebase-merges Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Eric Sunshine , Johannes Schindelin , Junio C Hamano , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren When --rebase-merges was first introduced, it only worked with the `recursive` strategy. Some time later, it gained support for merges using the `octopus` strategy. The limitation of only supporting these two strategies was documented in 25cff9f109 ("rebase -i --rebase-merges: add a section to the man page", 2018-04-25) and lifted in e145d99347 ("rebase -r: support merge strategies other than `recursive`", 2019-07-31). However, when the limitation was lifted, the documentation was not updated. Update it now. Acked-by: Johannes Schindelin Signed-off-by: Elijah Newren --- Documentation/git-rebase.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 55af6fd24e2..8a67227846a 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -1219,12 +1219,16 @@ successful merge so that the user can edit the message. If a `merge` command fails for any reason other than merge conflicts (i.e. when the merge operation did not even start), it is rescheduled immediately. -At this time, the `merge` command will *always* use the `recursive` -merge strategy for regular merges, and `octopus` for octopus merges, -with no way to choose a different one. To work around -this, an `exec` command can be used to call `git merge` explicitly, -using the fact that the labels are worktree-local refs (the ref -`refs/rewritten/onto` would correspond to the label `onto`, for example). +By default, the `merge` command will use the `recursive` merge +strategy for regular merges, and `octopus` for octopus merges. One +can specify a default strategy for all merges using the `--strategy` +argument when invoking rebase, or can override specific merges in the +interactive list of commands by using an `exec` command to call `git +merge` explicitly with a `--strategy` argument. Note that when +calling `git merge` explicitly like this, you can make use of the fact +that the labels are worktree-local refs (the ref `refs/rewritten/onto` +would correspond to the label `onto`, for example) in order to refer +to the branches you want to merge. Note: the first command (`label onto`) labels the revision onto which the commits are rebased; The name `onto` is just a convention, as a nod From patchwork Wed Aug 4 05:28:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12417891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1440AC4338F for ; Wed, 4 Aug 2021 05:29:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F322160F43 for ; Wed, 4 Aug 2021 05:29:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235343AbhHDF3P (ORCPT ); Wed, 4 Aug 2021 01:29:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235306AbhHDF3N (ORCPT ); Wed, 4 Aug 2021 01:29:13 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F6F7C061799 for ; Tue, 3 Aug 2021 22:29:00 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id k4so846076wrc.0 for ; Tue, 03 Aug 2021 22:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=orxdWDoDW6Mkyzypekhi5kd1qSdh25358N+ckFh/UCA=; b=p7vfwzYVxQeJhU7oENWBdVGqnfrmf2aKEaZp9AWnGxYSJO/h/OLHvjZDiNIfajFjLz A4dJ2jQv1QW4nNB3l+o/YbIm7+D5182D6DiMHayYujkQtOJ0x68uLBBrDjgH3SJrft/O xYF4a6nK2d5mKVA+1Iqv3rOOPLZlgidCXi8/G8bHefhvCJF47uey2z3f7xrFhw+N01hp MxdQMz9nJ+34fJYegbY597jlyiAaNmeB6bSlLfxYQWdo46la1rzzIb3s9AYFkdQvX7EG Mm0p7f3yLIDr7uYfgCwNnE6DPZWKcRfzgO9zNL/2RL/Vh1rg7QcS56IXRGT1NngviQl5 FoHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=orxdWDoDW6Mkyzypekhi5kd1qSdh25358N+ckFh/UCA=; b=tl14v798O90ebuMSn5h7Ve/vye7HHs7m7Cy5sMSiZcn1rtuRr005n9uL/l93JB5Y9o 9eMQCN8ivN7+LRSi5TbF3j7MTRkcCvN6vc4yKQVU9XhsI8o9r31WMQRcuFea5bdr/D// Ex2G7XluKDb/xHUDkfnBH46jP5xFvqo4kNgGj038dsj3kLHIpXsSWBGlKOc7SdSPRF7U i6spydnc6ZoR0aehzWnUbKKyH0DrRiDHzSsbIMbkbZwtuBb4otOSrl2bb0FEmZDLYEB7 mADCu126zJhRG38NkLyUNFsnYvuy6Iu0YNKE2jBo2nYefbXlb18/ISbDaUv5fWVzZpo3 Lt2w== X-Gm-Message-State: AOAM5327TaRnq95SQSinBMyEDY8kRS0aejoHk/f99nCoueuZpGzuuhXc OYA8HxpAnVclHJuKLkfOyWUmLLTZSIg= X-Google-Smtp-Source: ABdhPJxEy5ujgYlerDp/cgy5MYb9RWBV7MhHxrWHMi/ns4DMzy3VY31FBz3odKyGB6dy0Plo/OqPUg== X-Received: by 2002:a5d:6b8f:: with SMTP id n15mr26270256wrx.103.1628054939048; Tue, 03 Aug 2021 22:28:59 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id w3sm981634wmi.44.2021.08.03.22.28.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 22:28:58 -0700 (PDT) Message-Id: <3fdd068231a22375f979212189dfdffd4a2e4660.1628054936.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Wed, 04 Aug 2021 05:28:47 +0000 Subject: [PATCH v2 02/10] directory-rename-detection.txt: small updates due to merge-ort optimizations Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Eric Sunshine , Johannes Schindelin , Junio C Hamano , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren In commit 0c4fd732f0 ("Move computation of dir_rename_count from merge-ort to diffcore-rename", 2021-02-27), much of the logic for computing directory renames moved into diffcore-rename. directory-rename-detection.txt had claims that all of that logic was found in merge-recursive. Update the documentation. Signed-off-by: Elijah Newren --- .../technical/directory-rename-detection.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Documentation/technical/directory-rename-detection.txt b/Documentation/technical/directory-rename-detection.txt index 49b83ef3cc4..029ee2cedc5 100644 --- a/Documentation/technical/directory-rename-detection.txt +++ b/Documentation/technical/directory-rename-detection.txt @@ -2,9 +2,9 @@ Directory rename detection ========================== Rename detection logic in diffcore-rename that checks for renames of -individual files is aggregated and analyzed in merge-recursive for cases -where combinations of renames indicate that a full directory has been -renamed. +individual files is also aggregated there and then analyzed in either +merge-ort or merge-recursive for cases where combinations of renames +indicate that a full directory has been renamed. Scope of abilities ------------------ @@ -88,9 +88,11 @@ directory rename detection support in: Folks have requested in the past that `git diff` detect directory renames and somehow simplify its output. It is not clear whether this would be desirable or how the output should be simplified, so this was - simply not implemented. Further, to implement this, directory rename - detection logic would need to move from merge-recursive to - diffcore-rename. + simply not implemented. Also, while diffcore-rename has most of the + logic for detecting directory renames, some of the logic is still found + within merge-ort and merge-recursive. Fully supporting directory + rename detection in diffs would require copying or moving the remaining + bits of logic to the diff machinery. * am From patchwork Wed Aug 4 05:28:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12417893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BF3EC4338F for ; Wed, 4 Aug 2021 05:29:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8277060F10 for ; Wed, 4 Aug 2021 05:29:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235377AbhHDF3S (ORCPT ); Wed, 4 Aug 2021 01:29:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235322AbhHDF3O (ORCPT ); Wed, 4 Aug 2021 01:29:14 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AF5BC0613D5 for ; Tue, 3 Aug 2021 22:29:01 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id k4so846087wrc.0 for ; Tue, 03 Aug 2021 22:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=u2OexVHCWIr4ZGDtSXlLtMCutTpWklNj+dqklHUXpRk=; b=coqO8ebmqLMEBVkNoAoqNNnm4j6gP3C2VeL+V+yQvaa78sOJ01PE8KA+dx2MlLcpxO GqQ7uKSpUsTPbbE+tocJ4O8btZpMAo/0z3iS2X+sokYOkneSZvQLpxJzJM6bhI2AJcO1 WN1uchxtqy2nABEQt3izPgh1vR3Yb2R+yULMfQ8b3xyriBgqsJPt5Ue00xFI7QI1kWvj 1ND+WZ1cLvCehS7mAfTvzWkS0RgFh52fOdowhei/svTwR06PwbUc8A+kmSXS4HZNs69j Mr+YSlDA3Q7Z0+IYfHe8UkcgEokHotWvqEa8q328TLPEeslbMZ4Jy/AKWPN8ETlqHNxD PVvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=u2OexVHCWIr4ZGDtSXlLtMCutTpWklNj+dqklHUXpRk=; b=otGDjVV1NNgEN+VS82BHbbGJEj+Hr8M/ibcIZXZb7499mHp5tkBBQc+pqso8SyD0rP 43iXJKIl3F4Awnth4qmC6z2fH70xRsFQp5bTXXPGTt8mHJUfy6LzqmQrXLa+/F45e+Ml eXejxDVmea5Ssr/oCNUfQND0VLUL+6lQ4YdEbogeVKB57PbjdyeUDFX7YFuCeUt2SnZ6 XEbJ2o48Gp/pHKTOTg43eOBnLOwGJZsFL6Am2b9fWE+RACjN3d670SolyYvx/U6dgk6i HM11uOyi6hAxaj4n3ha/STvUcJleRvMZSYnmswAUA1lqbrnyZ+Xio53bQSDdtkooVh5m Ml6Q== X-Gm-Message-State: AOAM53308Be4cpzTo9wXxtZXsRqp8Negd4j2eMdbfUIJQJ7+7+sH5H6p iMSIFbccnRaQwXUkaCsUR/KjwKnsAcc= X-Google-Smtp-Source: ABdhPJxi+aQzqqHRfky/+kaDkePutvekedOoux2PS0Pq9SavhWuisijkSAXU/6v5aGTSkquEZ1u/dA== X-Received: by 2002:adf:fa11:: with SMTP id m17mr26598210wrr.150.1628054939646; Tue, 03 Aug 2021 22:28:59 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id l5sm1220508wrc.90.2021.08.03.22.28.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 22:28:59 -0700 (PDT) Message-Id: <2a38320c2be2fb859bead9f54e396b4e97020f32.1628054936.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Wed, 04 Aug 2021 05:28:48 +0000 Subject: [PATCH v2 03/10] Documentation: edit awkward references to `git merge-recursive` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Eric Sunshine , Johannes Schindelin , Junio C Hamano , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren A few places in the documentation referred to the "`recursive` strategy" using the phrase "`git merge-recursive`", suggesting that it was forking subprocesses to call a toplevel builtin. Perhaps that was relevant to when rebase was a shell script, but it seems like a rather indirect way to refer to the `recursive` strategy. Simplify the references. Signed-off-by: Elijah Newren --- Documentation/git-rebase.txt | 5 ++--- Documentation/merge-options.txt | 4 ++-- Documentation/merge-strategies.txt | 9 +++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 8a67227846a..c3edcb07e3e 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -354,9 +354,8 @@ See also INCOMPATIBLE OPTIONS below. -s :: --strategy=:: - Use the given merge strategy. - If there is no `-s` option 'git merge-recursive' is used - instead. This implies --merge. + Use the given merge strategy, instead of the default + `recursive`. This implies `--merge`. + Because 'git rebase' replays each commit from the working branch on top of the branch using the given strategy, using diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt index eb0aabd396f..f819bd8dd68 100644 --- a/Documentation/merge-options.txt +++ b/Documentation/merge-options.txt @@ -112,8 +112,8 @@ With --squash, --commit is not allowed, and will fail. Use the given merge strategy; can be supplied more than once to specify them in the order they should be tried. If there is no `-s` option, a built-in list of strategies - is used instead ('git merge-recursive' when merging a single - head, 'git merge-octopus' otherwise). + is used instead (`recursive` when merging a single head, + `octopus` otherwise). -X