From patchwork Tue Aug 3 15:35:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12416613 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 A06C4C4320A for ; Tue, 3 Aug 2021 15:35:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8722E60F9C for ; Tue, 3 Aug 2021 15:35:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236936AbhHCPfi (ORCPT ); Tue, 3 Aug 2021 11:35:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236909AbhHCPfh (ORCPT ); Tue, 3 Aug 2021 11:35:37 -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 00A39C06175F for ; Tue, 3 Aug 2021 08:35:24 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id b11so20448010wrx.6 for ; Tue, 03 Aug 2021 08:35:24 -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=m3VHVrtVKgyuxPzA588+WumvXXozyv386IvSD4PUP+M=; b=KYxZ5E+wGkFvsOmokslLg6wiECEHGOvJbUf2Do1OugXTGyyb8QyPWptoUpoXubbwFX THSRzjAfSM1jcMD7I9sp0b1tb0drHnZGDaWiGdFHUnsjGGTw9z7PGHxBYSO0ivJKb2Je XkziJ1VTTvCSfGASLkIFlGckW6nZuSHb/SZ90nAgoVX3xf+xSut8jqwBc13OVRAu0Lwp vN/VVZg2Q8WTBb1TFdEwy9rMwHcGqEyAeBKs2lVzX7J5o85UIxYBPs2cMRwlOIcCR48H MYQ8Nkw0ZldNMKG3e6Lt0xZL1vmOe+ZvjL2AJTyckVGAMj3wx8UWrP3DVoch+Z8mFc8X gSTQ== 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=m3VHVrtVKgyuxPzA588+WumvXXozyv386IvSD4PUP+M=; b=b8xsyttorUCDWosFUbtOA4kb0RLMMXM/a/sNwcymN23vYhcZes70ujPnQhQDi7cgWX CErFxcMxPnxEVINxDeXWu7xH4FRf1tn3aSDzfg2UQYX4LHBRmfK8n03mgG70DN9IVPhZ b3OU2lW7qYlLyVcyY8zCXIptEVBitC9oQ0AwzsYuhqXw4C4x2YhfRyOorrAi/KcOgxIL 1CZzWgAHWRZnvluICRgyONQ+hhlnIoR3CKnpqbsD7G+qtPZoakXBtfv7zMb2SomxtcMk X+zX3RL1mMZ9Pp9Qx+YZPjVPwd1rDBq99KaT5jOoTHdErfmsmaTrYJZgF4lO4Pf0mkkv 1D1Q== X-Gm-Message-State: AOAM531zBYWYhYENFE9Yf1rVwwEYmgK3obw7KSXuyu3QV9J2naFJ1Wr5 Vml+hiy7LfM/DjRP6HOy40JyqcUjhIc= X-Google-Smtp-Source: ABdhPJzdJtjHZGmJZV4Dc+IZ51IDwwWqTAXUwUHIy5M+aQRgij+h/jcOc9x0GF61pfPwMtMqXdKUgA== X-Received: by 2002:adf:db85:: with SMTP id u5mr23820256wri.167.1628004923507; Tue, 03 Aug 2021 08:35:23 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id b15sm17528819wrr.27.2021.08.03.08.35.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 08:35:22 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Tue, 03 Aug 2021 15:35:11 +0000 Subject: [PATCH 01/10] git-rebase.txt: correct antiquated claims about --rebase-merges Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: 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. 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 Tue Aug 3 15:35:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12416615 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 67EDBC432BE for ; Tue, 3 Aug 2021 15:35:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4916460FA0 for ; Tue, 3 Aug 2021 15:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236618AbhHCPfj (ORCPT ); Tue, 3 Aug 2021 11:35:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236892AbhHCPfi (ORCPT ); Tue, 3 Aug 2021 11:35:38 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE752C0613D5 for ; Tue, 3 Aug 2021 08:35:25 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id k4so14964827wrc.0 for ; Tue, 03 Aug 2021 08:35:25 -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=q3iyGyMsntgkkVtWWLLsGSMUCBpMa37lTf6uj2z6Di+sG4KFncA++nD4fI3WNqusrB ebORqD9BYj3DUypp7ntYVV2YmWsrum2pJ1j07b0yRQTHli1EE4zbYeR0TkfSgTjLI87v vMzTi34GfrzIXacShIvpq3jTuver7gR9jNvdm0abbSSUfy7ffeRN65KD3ZaR2R2y6beR tKvConZCYuX6wSC+k6/4VwEWshQ7SC1lI5yIvPAeyNz6mUdsUzGhLfHjRwk/gWwrWWmg Pg6z7NjuPhJuj6Vh8plCpQvcFDuu6w7OMKvODdPs65uxorjk0SSSe8XNjFLTccS+Lk22 ncLA== 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=Hrewglm0/CIgPks913hqdmcoq5Kn8uE2pjeR7KtZ9Pda9SIjy/UmCtCVoROqoBeWC6 N+qrz2ofsdZkw4xfkNA+7KYk3JTiUHMopOukiFlI40vfUJRgfwedDWp3f6SooLiVDpz2 wTFY79Mi40s2QHDhKVP0JTat3WQSg9hnlKLc0b4DJl9dnpmQwVG/X4Qn3pXS9bHbfBUi CFMvDRPftDnU/xGp4VG4oaL/3mum1ybSdCza2WH/Lr1q7XVehgs/Q5+NiXwhXp1gPeLK LWNJnGXbU8m81l1SeDXhG964T0KmXt3QOX3jE3B5X5GPv/oROW5dxk1FMhSeejXHJBdN CCGg== X-Gm-Message-State: AOAM530lw630bZntiW317Rj+4C6FcPofSbO3oentUCSncGFSXZaOTEm1 nKRhbDQ9zkd3UZVU28uwGCQrOLxHsDU= X-Google-Smtp-Source: ABdhPJwp4QZ+RCaaX7835kIsutmIPKjHjfCLgCK++G1nvr0MGIFnkb6wUH3+qu92gz4yYrZD3C7rKg== X-Received: by 2002:adf:ee08:: with SMTP id y8mr23426971wrn.299.1628004924531; Tue, 03 Aug 2021 08:35:24 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id v15sm14424574wmj.11.2021.08.03.08.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 08:35:24 -0700 (PDT) Message-Id: <6b89ab8d9b1c03ce97fab73f7a2b4261fd90c0c4.1628004920.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 03 Aug 2021 15:35:12 +0000 Subject: [PATCH 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: 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 Tue Aug 3 15:35:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12416617 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 17E3FC43214 for ; Tue, 3 Aug 2021 15:35:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE40A60FA0 for ; Tue, 3 Aug 2021 15:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236698AbhHCPfk (ORCPT ); Tue, 3 Aug 2021 11:35:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236938AbhHCPfi (ORCPT ); Tue, 3 Aug 2021 11:35:38 -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 C2354C061757 for ; Tue, 3 Aug 2021 08:35:26 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id c16so25756194wrp.13 for ; Tue, 03 Aug 2021 08:35:26 -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=4yrDo3FEcFUFpHnn04Gn/u+Bdr1H0IobTSGYGJFpato=; b=VsFOEquySf2NQ+M8VPCDteStS0bUVSlQNUmZYc3HtzROH84plmS0KLIA1xE2h7cDk+ eiWSnoaiVtfjgtUO5I2ELVHq4U6/98RCfxyhFidVNF3qV4kBCI3i8g/0+ySP1v+KiFio iDoSgLE3vmEtrwZV0SMe3XbA/R2bhvMkcrtnSgnEKBtbh3LTCwgyrz6OJ3SvDUYLYSzr 7GmcFW61E7yR2gdaglY1GvvDh409QB5WBJvIbK8+dTyQG8moZ2dVEgYvwbIwJit7Gkp5 EXoKo3WivPPPAfgZAAMGlfDFjY4wHwbFzEATpxyMhtgf0Tv9o3gwdDwDMdcHeX5dw8dk 3fMw== 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=4yrDo3FEcFUFpHnn04Gn/u+Bdr1H0IobTSGYGJFpato=; b=JMsm9EQTsJIicHrucOsCYX8j+OlDRF7AKWU7QOKlwbs7qW7605GJAy8o9IMsr1qLOj BYIwNOqR9OisW2Yvvr97A6HuX+TKDO/04Y90vQfDiiQqinuQwejdsF0iXVhh+ejm19Yo lNRcRNIDLuydCnAfgsbvsGBaL84A7JsVJcRUsLSLQxqIKHLNvtisno6EMxQT1dT4as3q d8hQt6UE5vlU7p4ySMxftYoRMRmxj5oP0Pckd1ch3gPcE9jSAumh5mZgOXadiJ9mfbZ+ B80eueTGfUMiVkxYmFPhnexEpFQ53xxJjOsplOoklLb30jSKLLM9zVSG5ycg0fq5RGxs jVTA== X-Gm-Message-State: AOAM530eOfllO43i7ERQH9zHMRQw5Ft5vSDM5r2AJViz2z1YBXNYOQZR 21CKSiJIikfTl+mmRJYYnGFf9NVEIkg= X-Google-Smtp-Source: ABdhPJzmCRwRLznf4m5UzsJBt6JbSKdAL2nc7EFdcw85ESWXRjmvkYQVXBKrblpzOW9TQzOGLNegUQ== X-Received: by 2002:adf:eccc:: with SMTP id s12mr23358046wro.331.1628004925402; Tue, 03 Aug 2021 08:35:25 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id f15sm14341708wrp.12.2021.08.03.08.35.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 08:35:25 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Tue, 03 Aug 2021 15:35:13 +0000 Subject: [PATCH 03/10] Documentation: edit awkward references to `git merge-recursive` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: 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 | 4 ++-- Documentation/merge-options.txt | 4 ++-- Documentation/merge-strategies.txt | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 8a67227846a..7044afba362 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -355,8 +355,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. + If there is no `-s` option the `recursive` strategy is the + default. 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