From patchwork Sat Jan 7 19:39:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13092322 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6F0BC54EBC for ; Sat, 7 Jan 2023 19:39:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232151AbjAGTj1 (ORCPT ); Sat, 7 Jan 2023 14:39:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbjAGTjX (ORCPT ); Sat, 7 Jan 2023 14:39:23 -0500 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 E7B8340C27 for ; Sat, 7 Jan 2023 11:39:22 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so1081550wma.1 for ; Sat, 07 Jan 2023 11:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=AyUgHjw8gfloEMDd5GGwhkVmyVlOEUAhR1Crsh4GblQ=; b=PHITxyQEBvwS/hT5G3rViHH3mH401cw8GzFG4rezBHpsNxbNE8KR61f14fwkTdlgJf UMhE7vW7RHhfhJT266gXkHkp3IoMh0xSvZyhOG/PqFn4dmS8TjJIDfCvh4J/MjsGm7H3 z1jY++m7GxqbCbezo1dRVRpTTsQgBx3Klzlqq1s5DCeUnXCtu40VtTzykgTtHvkiCtBn ckTWC5nQhHj6Tq+Fe0lwLX4AQbB39QQaXaKC2w8z82E+C8v6IVuKOgQW9ijoUWOnY24b 3fsH+Q54/1HNKXpR7nsIYq6dYRV2PInIE9Lqnm1xkzMCYGOY0MPSRNWfMGVRpUy9bSt3 0YEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AyUgHjw8gfloEMDd5GGwhkVmyVlOEUAhR1Crsh4GblQ=; b=UOp8WibqsFyJpdvBcZfzKSXTwX1x0PO0XpbuZNLQ3gor0dfm+hV8S+HWpNJfyrVyec gnKSQrgl+cv++0LhS+eB8yOSaCefhe8hQNFquoa60fCOZGkjnqnXbyDNlSgReMOltJ9d 7UKeJGvM1MgshfXEzgpAddRUH89mlurhybsTUrc6flPB4FYo0fPJkdG8TKuCXa3zLHuW EVzXXjKBYWhOJ71yTmE2D0CywVjG3IdAXoe6mgnRRKTG1wIWviWxDAVVxegOTQK4Z1y8 O6+sepge1TPF9ID/g1RmcuobWArQ8bt3JbA2gw1JkwphusdIjwRdQ2u1DI/GyGHj+KGR U2BQ== X-Gm-Message-State: AFqh2kpwF/kO8tJLdGTreyunNUOc45a5/Uv9c6okmbC0Gjl1KJ057fY9 L9SZflBsajGyMytu4nYIivdxRe8+39g= X-Google-Smtp-Source: AMrXdXu4sbArJ2XGu0eHjJ293QiPjgQwZJS9Cx/HhrVt8akTjA7k49PKc2+eX+peutbK0fSuE5mEHg== X-Received: by 2002:a05:600c:3844:b0:3d3:4406:8a3a with SMTP id s4-20020a05600c384400b003d344068a3amr51429471wmr.30.1673120361296; Sat, 07 Jan 2023 11:39:21 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id t12-20020a05600c198c00b003d9de0c39fasm7269223wmq.36.2023.01.07.11.39.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 11:39:21 -0800 (PST) Message-Id: <74b2d5a9144e4893311d9acfb0b5e8268da6f0f0.1673120359.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 07 Jan 2023 19:39:15 +0000 Subject: [PATCH 1/5] git-cherry-pick.txt: do not use 'ORIG_HEAD' in example Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Erik Cervin Edin , Phillip Wood , Philippe Blain , Philippe Blain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Philippe Blain From: Philippe Blain Commit 67ac1e1d57 (cherry-pick/revert: add support for -X/--strategy-option, 2010-12-10) added an example to the documentation of 'git cherry-pick'. This example mentions how to abort a failed cherry-pick and retry with an additional merge strategy option. The command used in the example to abort the cherry-pick is 'git reset --merge ORIG_HEAD', but cherry-pick does not write 'ORIG_HEAD' before starting its operation. So this command would checkout a commit unrelated to what was at HEAD when the user invoked cherry-pick. Use 'git cherry-pick --abort' instead. Signed-off-by: Philippe Blain --- Documentation/git-cherry-pick.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt index 1e8ac9df602..fdcad3d2006 100644 --- a/Documentation/git-cherry-pick.txt +++ b/Documentation/git-cherry-pick.txt @@ -219,7 +219,7 @@ again, this time exercising more care about matching up context lines. ------------ $ git cherry-pick topic^ <1> $ git diff <2> -$ git reset --merge ORIG_HEAD <3> +$ git cherry-pick --abort <3> $ git cherry-pick -Xpatience topic^ <4> ------------ <1> apply the change that would be shown by `git show topic^`. From patchwork Sat Jan 7 19:39:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13092323 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D062C46467 for ; Sat, 7 Jan 2023 19:39:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232574AbjAGTj3 (ORCPT ); Sat, 7 Jan 2023 14:39:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230517AbjAGTjY (ORCPT ); Sat, 7 Jan 2023 14:39:24 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AE2F40C1D for ; Sat, 7 Jan 2023 11:39:23 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id ay12-20020a05600c1e0c00b003d9ea12bafcso504161wmb.3 for ; Sat, 07 Jan 2023 11:39:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=sHxC13MyFotC5MxLeE4I4+HCHPqO4Q1rk2RPC0DEs7o=; b=NNcCBTnfS/sfnMn7hlGVKR0a4S1wwV2+SRh1/u40mlKXIAqWvzLjSVIafP6I5OHE14 85pABazT31xL5NyZpKfEDcFEw687cdOVo0IH/1+VvUyxuZf4aXZm9QzIaZKo5yEMM7ga D1J1wk0sZTNTtK8eJeRPj1+T8ecRzUBn2d7HST+IPPaWrSRdAkXfITeZaN/4XGb+8DsM MEgaGzvDxZyHCSpvI+uO8jhh9X18qYkkfsE9ZkjcX+5Gbt13CXWvFUqkklZcsojk9Yi4 i8ICnNlU8XZO/DtV8NBQwuGBs1EIysZwf9ikhmMvnA3T9hzt9Gozn5ksjUWfGzkf5C77 gK4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sHxC13MyFotC5MxLeE4I4+HCHPqO4Q1rk2RPC0DEs7o=; b=iDcVkwFfVYm9U+Y46OP7sDfjVCwZiVeG+egxmNKmhXE+e0oQ9D7NAOtSM9B4hSWkLG f5Bi3MyjT1JpIFx3jgFB5KfdFmlBYV8x5z7bN8r/B0wCrCQMPlW8M6WnIf3SafJc+Cmg YiRCvB3NKwcZSVuDRlzxdtzppoFubkRp2FAc8eY0qsom58Ggq3w9czt6HPEVQo0UDtNr sZiBGCieE4mTSXsol9/E2SiBCde9APujzz5B7j6TKww3gK0LkTR4LKFnOZWSsU54xp4r PuK5RluMeNN3GfSGpwEo6YpUAyR8UJhR5e6iSTSgOZ3sAAm09AS7vkG1yZiFVVLjzzMX wbyQ== X-Gm-Message-State: AFqh2koL1i1EmsnY0cwTw/MJFHqPmswolnVIQr8KTeZYXQbj+5VeSJn8 LMQ8EqNOwACqIN6ctz4/rqWFdvRomG4= X-Google-Smtp-Source: AMrXdXsdnc9hnv4ChIgLe3fqzxaDKfIhc5opIUIPGBF+Zf+tfDnnnL+nCVGHQj1Robwu3e4XaGXGiQ== X-Received: by 2002:a05:600c:4b0f:b0:3d2:2651:64bd with SMTP id i15-20020a05600c4b0f00b003d2265164bdmr42583508wmp.10.1673120362029; Sat, 07 Jan 2023 11:39:22 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id bh13-20020a05600c3d0d00b003d358beab9dsm6076989wmb.47.2023.01.07.11.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 11:39:21 -0800 (PST) Message-Id: In-Reply-To: References: Date: Sat, 07 Jan 2023 19:39:16 +0000 Subject: [PATCH 2/5] git-reset.txt: mention 'ORIG_HEAD' in the Description Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Erik Cervin Edin , Phillip Wood , Philippe Blain , Philippe Blain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Philippe Blain From: Philippe Blain The fact that 'git reset' writes 'ORIG_HEAD' before changing HEAD is mentioned in an example, but is missing from the 'Description' section. Mention it in the discussion of the "'git reset' [] []" form of the command. Signed-off-by: Philippe Blain --- Documentation/git-reset.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt index 01cb4c9b9c5..79ad5643eed 100644 --- a/Documentation/git-reset.txt +++ b/Documentation/git-reset.txt @@ -49,7 +49,8 @@ section of linkgit:git-add[1] to learn how to operate the `--patch` mode. 'git reset' [] []:: This form resets the current branch head to `` and possibly updates the index (resetting it to the tree of ``) and - the working tree depending on ``. If `` is omitted, + the working tree depending on ``. Before the operation, `ORIG_HEAD` + is set to the tip of the current branch. If `` is omitted, defaults to `--mixed`. The `` must be one of the following: + -- From patchwork Sat Jan 7 19:39:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13092324 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 187C5C54EBC for ; Sat, 7 Jan 2023 19:39:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232804AbjAGTjb (ORCPT ); Sat, 7 Jan 2023 14:39:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232050AbjAGTjZ (ORCPT ); Sat, 7 Jan 2023 14:39:25 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C74540C23 for ; Sat, 7 Jan 2023 11:39:24 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id k26-20020a05600c1c9a00b003d972646a7dso5895220wms.5 for ; Sat, 07 Jan 2023 11:39:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=+5aPED1uDz8pjLLfA3pRQirKJaCrHhp0HaOqnh1rWgA=; b=jTvt+U/5bt8pOIf5tBm6LN0vdAbGsG/znVXrALGLGqqolvrHzWUSmzFEHBAawGydtF 3bG8gPckufRSM9bno8kZVmkloG8vVkxH3V+1mYy/lceTSKo4yak6VPETeWaBGgnlBD6W wfZoKmLq5K9JayULzFyqW0ga/7douJe505O7GJ+jg09rPlyYSrdM5ldBQdVDRMVxd7IE iItr2Ign+2aIYjgI2v9ZqJUsQqgmsb2oI/6dwNO8yG0RDx9SbIaTgZqiop+8wqCc1ART 0dVBGLyaKTvPyKSqUoJ3W94mlqgDB6V75zKkPO1waICM8QbpqJz9OTVptqRu6Kw6XWPD ormQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+5aPED1uDz8pjLLfA3pRQirKJaCrHhp0HaOqnh1rWgA=; b=C83dOeWDMDLk9t1nbxn4r/KGk4dNBV9P12ZubxbxQc4WxqKCipUjhO6P3PG1FT3Wlc JcUTL21msI/eeMAhpAxjYi6iCwdsRlSjFMpOZWyFqH6dRydXTKIFb8ZWTtUOTjZkheia iNsfZaI/rHXJ5CIIYy8QtZKXNs7vzLt5jLNzxZHJX/CWDnQuSjPz5OoVLYRm0Mm0h+lY c57dxZPkYpmRm3TIBkiyRJPl7FhkAQmy3Gp+dNv9P0qzZuCsTpEWiqwg5ahJx+Ji2Ll9 6lYNxW8NSMADE/g46VCNp5qh/ogF3JlYU9X8XLOY7yLawXU5x/WmFJe9aeHHTvLhtgH0 idcw== X-Gm-Message-State: AFqh2kqzr4RqcnH6Zt2wAaMCgvR/gdlZieqsu0My+TKWcfSm53F5T/dR hMmCxijhHn5l5PTRa1wjHEmf0IeFClE= X-Google-Smtp-Source: AMrXdXuaS7Tww9i0i+ZjJXnbV1YuCQxsBRxfj6qYG+qt7++qItu7HErsn4j7W6cC0uwyoYrNw5jSfQ== X-Received: by 2002:a05:600c:378c:b0:3d2:1f10:3318 with SMTP id o12-20020a05600c378c00b003d21f103318mr46642441wmr.31.1673120362594; Sat, 07 Jan 2023 11:39:22 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id bg24-20020a05600c3c9800b003cfa3a12660sm21382269wmb.1.2023.01.07.11.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 11:39:22 -0800 (PST) Message-Id: In-Reply-To: References: Date: Sat, 07 Jan 2023 19:39:17 +0000 Subject: [PATCH 3/5] git-merge.txt: mention 'ORIG_HEAD' in the Description Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Erik Cervin Edin , Phillip Wood , Philippe Blain , Philippe Blain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Philippe Blain From: Philippe Blain The fact that 'git merge' writes 'ORIG_HEAD' before performing the merge is missing from the documentation of the command. Mention it in the 'Description' section. Signed-off-by: Philippe Blain --- Documentation/git-merge.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index 2d6a1391c89..0aeff572a59 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -37,7 +37,8 @@ Then "`git merge topic`" will replay the changes made on the `topic` branch since it diverged from `master` (i.e., `E`) until its current commit (`C`) on top of `master`, and record the result in a new commit along with the names of the two parent commits and -a log message from the user describing the changes. +a log message from the user describing the changes. Before the operation, +`ORIG_HEAD` is set to the tip of the current branch (`C`). ------------ A---B---C topic From patchwork Sat Jan 7 19:39:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13092325 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C74DC54EBE for ; Sat, 7 Jan 2023 19:39:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232859AbjAGTjd (ORCPT ); Sat, 7 Jan 2023 14:39:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbjAGTjZ (ORCPT ); Sat, 7 Jan 2023 14:39:25 -0500 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 E859A40C1D for ; Sat, 7 Jan 2023 11:39:24 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id w1so4238883wrt.8 for ; Sat, 07 Jan 2023 11:39:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=JosiX1xP/mchjg1cQDmwxKPcSqzEfpT1h8/Zc0H1rWg=; b=bBLPvkedJBEbt4jel+2FWcZI7BlOOXPcWNWS9JCY2oV3zNcq+jxMF/pv5xqDCK6nrx +idTbGR1lSRqdmaA3pNrOwPspQOm1kFuGg73yBCLr+1xEecX7HLs2fIcCcyJcPlym/6A ugdnzOTMgXZBmtlou7BEAJRvz7ezePp8xmMZdaByr3wsnq+MYPDgc0LfrwF0UtFUBcyk Nh+5adGGAjBGSLncxBkz86GROgn1SSiAEhWkA5Of5qMWsIg12tWWpw4ZXEtVdnyDOpiw NN0T4CfjNJJNUgfiVk8x5O7eytwGt43iasleHJIC1rEYZuofl8NAjtGxA0hJH/vzjOYK QDRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JosiX1xP/mchjg1cQDmwxKPcSqzEfpT1h8/Zc0H1rWg=; b=ueXuz4Dt2e//IJpw1/jmVTCe7vvhv4UlrA6L/zzqpt+Qqb2EAL7rMVnJMyoT5kwPMB RMKgipX9DXtWDQCQEvwJhI8wj4dRvjaJLtVXbXerAxa90mS6drVNiT3fTLl3/O4jwcrt 0WZrxZPxLs/r4OuRxeDrI8G6kI/zaL6VQB15TEr/kEPRLQl4FDvX6tRb3Zpqoe2+oq4I GbbXAg68E5RfsB9wGRp4H11AjgpQb60WZ99ZTRdwUNxFXO9x1KxbaQTozyq09aaQtePs Rg5ZGMSst9GyBCXkNQabEgrKgsldHgkrJrOB2oE5zYglgGihn1/Sg2GCtBKFeVsqhTcx dAWg== X-Gm-Message-State: AFqh2ko19SEekgutw+0hLTV+OaecdzsefucbfO/fo9kxbL+nLBEfSDf8 XXvzK13Rm+LD3Tjcpjpab/6CCYNgnGw= X-Google-Smtp-Source: AMrXdXvRdVY7F7CBqP9YDIoRqhUFS30gTRRHDBUYaV+QgfcWLgNWsOan5M+hUnNKxdVYaXnLyJM+tg== X-Received: by 2002:adf:ec43:0:b0:280:cc12:2827 with SMTP id w3-20020adfec43000000b00280cc122827mr27995288wrn.21.1673120363415; Sat, 07 Jan 2023 11:39:23 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id l8-20020a5d6688000000b0029e1aa67fd2sm4429263wru.115.2023.01.07.11.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 11:39:23 -0800 (PST) Message-Id: <302b789a4869c2aa8a0de2f71a2725c6c567685f.1673120359.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 07 Jan 2023 19:39:18 +0000 Subject: [PATCH 4/5] revisions.txt: be explicit about commands writing 'ORIG_HEAD' Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Erik Cervin Edin , Phillip Wood , Philippe Blain , Philippe Blain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Philippe Blain From: Philippe Blain When mentioning 'ORIG_HEAD', be explicit about which command write that pseudo-ref, namely 'git am', 'git merge', 'git rebase' and 'git reset'. Signed-off-by: Philippe Blain --- Documentation/revisions.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt index 0d2e55d7819..9aa58052bc7 100644 --- a/Documentation/revisions.txt +++ b/Documentation/revisions.txt @@ -49,7 +49,8 @@ characters and to avoid word splitting. `FETCH_HEAD` records the branch which you fetched from a remote repository with your last `git fetch` invocation. `ORIG_HEAD` is created by commands that move your `HEAD` in a drastic -way, to record the position of the `HEAD` before their operation, so that +way (`git am`, `git merge`, `git rebase`, `git reset`), +to record the position of the `HEAD` before their operation, so that you can easily change the tip of the branch back to the state before you ran them. `MERGE_HEAD` records the commit(s) which you are merging into your branch From patchwork Sat Jan 7 19:39:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13092326 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1B19C46467 for ; Sat, 7 Jan 2023 19:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232884AbjAGTjf (ORCPT ); Sat, 7 Jan 2023 14:39:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232124AbjAGTj0 (ORCPT ); Sat, 7 Jan 2023 14:39:26 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82A2340C23 for ; Sat, 7 Jan 2023 11:39:25 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id bk16so4223562wrb.11 for ; Sat, 07 Jan 2023 11:39:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=vAVusEa+WYJlT2QZl2wcB4dBsaoK1D6Qy5w34U/QM8s=; b=cMCZoZO8+hOcr8WOhAkSuBmtyFcKQofGDP3Ul4xGF4BUOQI1USZR5iWbWpljqOkI+J knWMb/7P/jB9zynWA4mTDMWeYXPXOG70e+6kct3bM3OmR8CFlexcBU2UBJs0RGajGTGh D5lGdlHwtn80bm80QDLPJRCfmlCgRVZTR3ahYri0q501ezuvFJKSwltw5B5rZQlO/HeI BMblKJq2B8EdhL0sagCOOXp84XVKmRs2BwZRxTezMB3ssUjFdzGgCTSKcMtno2Uo0Ms8 F/jpFWXy5f87S4+DnVvcKxfSCi7V7YzRK0y6gwtlwdVJPAEHfYr5o/LAdOqlnyPwoUwr MWfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vAVusEa+WYJlT2QZl2wcB4dBsaoK1D6Qy5w34U/QM8s=; b=Y1eZ4CUji4oDIm2c0udH1g9IMn2cp+0Sa/kzBKyMinvkVzJCFKjSqj9YrilBOQKLQr 7KPPvTUKn92mzh1HWI160yKtegdRpLtmyd6+9qU5FZ/P5uYEQrR6lhA+CZyKG4Pv2lcB M4/zC8oup/FWT+ENu/AOpuGH7oX6apHc+vkg8En8FYQdLeochot2iPWtirUJDgBrZEd1 GvmnHucFCgTdouIoBWDBxwevDKWCmaZCXEfBpTBLN/5HbyyZd5Zbq+zeMzp7tVBnH9HK VGDWlypFGixy62NjSdWOwuvwrXydW7hKIjsxNS0Mt3kJB8gZB8LSvu2Z1AXQA6yCUUI9 /Gxg== X-Gm-Message-State: AFqh2kqrfe/OkeXPAiGCA5H1fX+qdJPnzg4NGk8wHwpL75ZbwGxY8zk4 IJbqQDhuTkTzitxaEKxd9nlaT+LJDXU= X-Google-Smtp-Source: AMrXdXtCu/nOKeufdoXrx9l3ZnP/H7qCY6cGh7GNQOB9w+SY8lbY5A1ILVESPkWGiduIiqPJXxqe4A== X-Received: by 2002:adf:f290:0:b0:242:144:90c4 with SMTP id k16-20020adff290000000b00242014490c4mr37856868wro.28.1673120363970; Sat, 07 Jan 2023 11:39:23 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id g6-20020adff406000000b00298d87b6309sm4515749wro.78.2023.01.07.11.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 11:39:23 -0800 (PST) Message-Id: <9ef427a9a2adfb6a47d13103f00a64df96725560.1673120359.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 07 Jan 2023 19:39:19 +0000 Subject: [PATCH 5/5] git-rebase.txt: add a note about 'ORIG_HEAD' being overwritten Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Erik Cervin Edin , Phillip Wood , Philippe Blain , Philippe Blain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Philippe Blain From: Philippe Blain 'ORIG_HEAD' is written at the start of the rebase, but is not guaranteed to still point to the original branch tip at the end of the rebase. Indeed, using other commands that write 'ORIG_HEAD' during the rebase, like splitting a commit using 'git reset HEAD^', will lead to 'ORIG_HEAD' being overwritten. Add a note about that in the 'Description' section, and mention the more robust alternative of using the branch's reflog. Reported-by: Erik Cervin Edin Signed-off-by: Philippe Blain --- Documentation/git-rebase.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index f9675bd24e6..d811c1cf443 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -38,6 +38,13 @@ The current branch is reset to `` or `` if the `git reset --hard ` (or ``). `ORIG_HEAD` is set to point at the tip of the branch before the reset. +[NOTE] +`ORIG_HEAD` is not guaranteed to still point to the previous branch tip +at the end of the rebase if other commands that write that pseudo-ref +(e.g. `git reset`) are used during the rebase. The previous branch tip, +however, is accessible using the reflog of the current branch +(i.e. `@{1}`, see linkgit:gitrevisions[7]). + The commits that were previously saved into the temporary area are then reapplied to the current branch, one by one, in order. Note that any commits in `HEAD` which introduce the same textual changes as a commit