From patchwork Tue Jan 10 13:15: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: 13095112 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 F3A7CC46467 for ; Tue, 10 Jan 2023 13:15:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238633AbjAJNPw (ORCPT ); Tue, 10 Jan 2023 08:15:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238592AbjAJNP0 (ORCPT ); Tue, 10 Jan 2023 08:15:26 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4DDC58D0C for ; Tue, 10 Jan 2023 05:15:25 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id bs20so11701342wrb.3 for ; Tue, 10 Jan 2023 05:15: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=AyUgHjw8gfloEMDd5GGwhkVmyVlOEUAhR1Crsh4GblQ=; b=iATCtiJt3uyKbWhe9Y1qFRJY5Uif0/W266noLZ4gNy1nLgsO3ShhoKDzeJOY5s8qLu CIOC1IfCzxeVGRWYmePStaebomG3RAO0HDL7SljI8KbHRrvu35jI3lHAWDVaiHauYqDt fw7ixZqZqwrrqXmk1otw0PtJ9Lxpk7H5o9/iJRobrBGV8WF4RWyn7MvWO2Rxw8BGz21+ 3NshTirJPRI+SP5xfWpwvlFjyiJmI3bpgDiA6cD+6f2FEJtvC7cnSDRqRBfyOCxqnanj u+ryFXlqZL+kFr8tO1FBxjXzTlsHBKmduRhUDi1509b7cp0S3UJeYfcWRJihdrGEozAp mDlg== 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=1jZNyn0abk9R8NwBZL+cTFGXE5Kl6yu5ipkFIzZPBVoyId3loXSGZrWag7IonsDGrl R0vzJv7hcHgWUqvreof2zkhzayDyK2ncY7lAIRHIylo/UFTxx+7jJRGRsNNEYtmq1pZW DXSk9+x7dw/7ysfraJ4tMnIOSRCxoXGc68Ps0WciOUAsWOE6d1xbgbKJaAJlbHmymdJG e9hvQbqHD7pvTGYl2aouEjMnIdEv/mAdwwKFX4hzkb67H1LtSS9w/nha3eYqrC8izAhz //M5ocXr9NvmkdGILlw9eVBkRwehEAk/ifoRNt4E/hOygv/npMcA/hzG4VIOecnmt0ak xqBw== X-Gm-Message-State: AFqh2koqob+fFw3ar/mSYFoRZyQGA+kwXB98iKnKDxebzj1cnNBJ6u7x b6h3Bmpkf/ogLD43xvYI+0Ja5koO4qw= X-Google-Smtp-Source: AMrXdXukS1C9jm9CQS8XaNDRkkAV9O1DM6Xh/TUetp3lebZb9VODCywBcwIOOLyMo75aS73nAr8kdw== X-Received: by 2002:adf:ec43:0:b0:280:cc12:2827 with SMTP id w3-20020adfec43000000b00280cc122827mr33684713wrn.21.1673356524024; Tue, 10 Jan 2023 05:15:24 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id bx11-20020a5d5b0b000000b002366f9bd717sm13788596wrb.45.2023.01.10.05.15.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 05:15:23 -0800 (PST) Message-Id: <74b2d5a9144e4893311d9acfb0b5e8268da6f0f0.1673356522.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 10 Jan 2023 13:15:17 +0000 Subject: [PATCH v2 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 Tue Jan 10 13:15: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: 13095113 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 99463C46467 for ; Tue, 10 Jan 2023 13:16:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238595AbjAJNPy (ORCPT ); Tue, 10 Jan 2023 08:15:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233904AbjAJNP1 (ORCPT ); Tue, 10 Jan 2023 08:15:27 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89006736D7 for ; Tue, 10 Jan 2023 05:15:26 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id j16-20020a05600c1c1000b003d9ef8c274bso5516208wms.0 for ; Tue, 10 Jan 2023 05:15:26 -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=bGrkQbD8R1IAQ+9lDO93PoCE6CuLZk1ZYTEIvHnBpQD52oJvJd+C0v3VgWtIClHBi/ 6n8hUAMb8OZbE5Myije0glFUDb2bl+ZZ1Q308XyDtYfrBRTPnsbdRhGb6lMORUn8RTzE 936BtrEzZ485hWmY1B+WdJiLYx6TXGUlo3zTCuwCuzaXkl/OSqvtpPqgg0is7DgBio/V DlAWx34U/ijr0IjjdWaLX2whJGgrrBDwR60wpbI0SR8rwa/KYIJqG0ha90I+qFY/r5jZ qK6PxEtc6zC1qyjEPbtpuzc8+OfBCwv57CEGQcEmyPFd0ICHQsatOJ3qh7+sA8lwVn/a sRrA== 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=Z5uP05mC89YytdKhtZ8IM0oPtgorZ5wr7DMcVjcFFn5uSoQhXtm1Ku4JzC7ZdjfDc3 GbfoHu1mF1GPpE3CNxhFNQCB/2QqVwHdK6sLrWny4qFdNcFr3U+sJRVapnVm59FPQ9Ex 4+aQpOahaq5mE3ojnUe08OpJWn1BYtTEblsdiCzhgVQyOCyoAj/1MPMvO7BVGaEHTg+3 pIpw7yo7BLwCTEhLtuMG+cBaXJh3AsSTcfVhSo8B6bLkZqBVqrXzycgqQcTbnW1Cuv3W nyMt9rgqybt88z9MJssd4Cz4rrRruoJgo17Y/F/PwQkPX2yM6K8GVyehiaUFuKXHdQFk Izfg== X-Gm-Message-State: AFqh2kpjzTp9YD+YMZkuu+ZLpjLrjcdEkUh9neulc3Kxge0QHKwMSf2T bgsRbNlTY7dKgGXoiJzoLEdOmDnCdlc= X-Google-Smtp-Source: AMrXdXsYaQ54wU25PeTu+UX2+G2D9AU64RE32MzwNRT+likb0bbafjY+kmJ+boUaYKDuEWogl85V4w== X-Received: by 2002:a05:600c:2155:b0:3cf:b067:4142 with SMTP id v21-20020a05600c215500b003cfb0674142mr48569497wml.4.1673356524907; Tue, 10 Jan 2023 05:15:24 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id t8-20020a1c7708000000b003d9f00c8f07sm6870460wmi.21.2023.01.10.05.15.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 05:15:24 -0800 (PST) Message-Id: In-Reply-To: References: Date: Tue, 10 Jan 2023 13:15:18 +0000 Subject: [PATCH v2 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 Tue Jan 10 13:15: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: 13095114 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 A7F7EC54EBE for ; Tue, 10 Jan 2023 13:16:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238613AbjAJNP5 (ORCPT ); Tue, 10 Jan 2023 08:15:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238606AbjAJNP2 (ORCPT ); Tue, 10 Jan 2023 08:15:28 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BA413FA1F for ; Tue, 10 Jan 2023 05:15:27 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id ay40so8761153wmb.2 for ; Tue, 10 Jan 2023 05:15:27 -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=IvmDOR6tMgSw872uHS+fUxi5FM9k94tXzUKRXKANvKHplR08NhQEhwRrSQTWvH5rJa y+acnHskz4YzZB663KtdRT8Sc6LMwB1WEMOvnyP80RnvHcaaIRBiOdzQ8wBMeHd0adEi kP0AiTa6MAK07nOTcmQHwA3mC6QWn4FbThI6l4ZzxChLrxEBTaLAKWifI6mtueba662h LjbLotdURcxho4dlUpkUJ3cYZi79zPJ8WSn2w7TFQ3QS2u3BHnTyJJyet4phXj8cT2fR KziZr88eYqvyoS6c7/GCV8HyZpSjPH/tLc7z6NVzoaIvwK4Bue6yVa54iZ9zE4Mp1rc7 gWEA== 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=R3oNYa5+aDW+EsuwE2AW/4SVkrVexlbBoteyUf18iD9POjWk9TvVwx46kn7uxaS1KA AGDHCVTGoibhvbk8ShnP1e3PnGhtVl9yNeFkUy5QoniLkLMTP4WuSmUWgOTUPSCHWVgx A2twZ5rfg5Ab+Nkoj865JHCHSUL+mnBF9RpIWpkHTbR+FmnVlc8xsTc+ZZ3Q7SvmEXeA PUaKao5x5KzQN3qhqeMZRe2UmItPKpXcm4T3unm3Zxr6jQHqsoAw/mAhaDJHqqMDoFcZ NVzlJfDx/dtfpQ9Y5EUenoQIqWQ1y58U0qdVqLdrBArlmh2O9IAI5cAi6XutqDVqWtKv AEKg== X-Gm-Message-State: AFqh2kqkK4KTMrVpputbHh7UirAEFUGw05Ty2aYxdb/gUSuA2gu9BLxN JDxXAUtfQfznVMi18ugR64Y9ku3mwd8= X-Google-Smtp-Source: AMrXdXu4TfDbUIkJBBB+e6JaqDMcNOIz5Ev0LAjZ5U23fa/uytazPlVdjHg5xVpihSP8GvSskCpxFw== X-Received: by 2002:a05:600c:3c8a:b0:3d9:cc40:a8dc with SMTP id bg10-20020a05600c3c8a00b003d9cc40a8dcmr16785763wmb.27.1673356525622; Tue, 10 Jan 2023 05:15:25 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id s23-20020a1cf217000000b003d1e3b1624dsm19414350wmc.2.2023.01.10.05.15.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 05:15:25 -0800 (PST) Message-Id: In-Reply-To: References: Date: Tue, 10 Jan 2023 13:15:19 +0000 Subject: [PATCH v2 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 Tue Jan 10 13:15:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13095116 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 03A18C46467 for ; Tue, 10 Jan 2023 13:16:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238646AbjAJNQD (ORCPT ); Tue, 10 Jan 2023 08:16:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234206AbjAJNPa (ORCPT ); Tue, 10 Jan 2023 08:15:30 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25F5A574ED for ; Tue, 10 Jan 2023 05:15:28 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so9881037wms.2 for ; Tue, 10 Jan 2023 05:15:28 -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=a3imvD8PRJBoMCOIRKVMKg8JqaPXSYajk57M+ek/gB9Z/T7dR13N2YU0PnzCgIgNXl uTGyV75P2S3wl8t1Z3ZtHHZLFQLk1Q6gm58UUtP7mkBTpIQpebUDAe0/IBbqmrtQKrvU mO5GFMstE78XJQ0APOI+dwUHR3ILfxWNgiHt/hcIykH7UCrbsjzql/QW3ngc6facK8lE MVRt6bnHgbbq1O+50KKxVOo8cTZJ+JA8Vs+FGNxlmXkJw9H1+KJPG9wIG75Ypg7j3gOV PYIcjIeggiGOrvcOey4QRhmYvTgFiQb9ihF1VnzNqIILuTSA3vNRshb19Z/XPZnzwaS4 WV3A== 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=ZAbYi7DLFLLqBfXlXEsDZ/eZNJ0QdF0rsFD81UrZ5fjKZRY8efTTPMQ5igjvW6+8gW WrKCnczTw6kCQT+ZVVMj7EcVqt3TDi2nu8HHFugzg3QDznAcN1IHC9oipsRhXgS7JWZL ayCf6mLtfqbMA/iPYHAe6jAIM0wohNSwj6Fm93q8Wi2zN4PxyQKVR25QRS5LoyTzOXAN 2TLIbUsi3Jouz/9YmBCOCHxeQLkwrnr27JwK87yUM5OdQ7tKgVape6rSGdmTaC5AnEIn II6hstMWefgm4QqafXFj4DOVLCFAeqlhNJf3d9kgZICso5apO6zRdqNIHtJmcTYKJn1V OlTQ== X-Gm-Message-State: AFqh2koe/mN2WLzy3tYlWqjwEgq9ly45rGp+9IiwzwG3ucwIhQJncXhW 4ZEgrwzUrWtunsxfEmw3jBUA/XzV5Yc= X-Google-Smtp-Source: AMrXdXu18TLaq05b4HGPjTcwemaAg3nWOsjWfLcAuZYhgZ3MxCNHzL1tUI612oSRvvPY5WvSuQ/kYw== X-Received: by 2002:a7b:c8ca:0:b0:3cf:728e:c224 with SMTP id f10-20020a7bc8ca000000b003cf728ec224mr49854612wml.6.1673356526598; Tue, 10 Jan 2023 05:15:26 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id u8-20020a05600c19c800b003d9780466b0sm16574861wmq.31.2023.01.10.05.15.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 05:15:26 -0800 (PST) Message-Id: <302b789a4869c2aa8a0de2f71a2725c6c567685f.1673356522.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 10 Jan 2023 13:15:20 +0000 Subject: [PATCH v2 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 Tue Jan 10 13:15:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13095117 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 8D63AC54EBC for ; Tue, 10 Jan 2023 13:16:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238647AbjAJNQI (ORCPT ); Tue, 10 Jan 2023 08:16:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238524AbjAJNP3 (ORCPT ); Tue, 10 Jan 2023 08:15:29 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E23274881B for ; Tue, 10 Jan 2023 05:15:28 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id ja17so8758070wmb.3 for ; Tue, 10 Jan 2023 05:15:28 -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=T6kIbfk9ffQmmT7q9M3iKH6tbpMv0HaJHtXL4461qpo=; b=jx7tCY6k5XqkLFTCcgx/1ilCtjEKGuVQW9T+c4jkkLvb0Ih1vCPma6sf1QO9/GLp3s Xoo7Hi947gGrACoRX6aXyIYOIcHdjh58VyIRJl0KjGPk1ii/Mmhce75WtX/MXHse+Nt9 ZY46o9N6AYgyJZm78N3k6u/hvW1RwrY4BWAUborRLImOOmt+s4otQ91WlRfpVxHus6hu dYlpwSw2oi9skJsAxbaq8CBcXtBMbi/r2giPQojRJtqqJZi6J9R9aEKzHIjKepKgRpwV SqNUmgWTPingZjdbDfkaf2LwZ+y/w8ebPK7w8WTXZ3+ZjD4lakcE5TZanHiD3sGNp/mq VAYA== 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=T6kIbfk9ffQmmT7q9M3iKH6tbpMv0HaJHtXL4461qpo=; b=Hfhfa+/4B/DofEGHIsE5ZJKV5Wtgh+q5J2SFRTnJhpK+lTAU3x6tGT4IjPu3K4DhKm YCsl81Lf1F54JRyKHeJ2+LL7+VGPZS7J1GDTR7TWREVU/m5t6tAVOSZhwt8ejbWNtJ6U tyNRA9i92aSiEe0jt2oIdJ9t4Q/iecAwqVwOHPOnrq0GJdmZGR2phOHtvJCuB5CUlsX6 Nuth6k0DCEdkP+PhDm7Nlwk1hb2vzSou7m3TXoizs4ST9Bu6VprPs0DDR6gMOlJT3ver KpzIOd4EcdIGtcQtnZNQ+BaMf1u7oM4QCzV6vtMgakuJyGCRFn+9iu9NwTYnNsB215uE hvcA== X-Gm-Message-State: AFqh2kqkq2VUKRuXlzDPWG+gP4NFvBLMC2mlsrBDtrIGdMfaZT2pqelx syeWKjRLajcSIxiM741ggukB9fZbfgs= X-Google-Smtp-Source: AMrXdXtfzX8K+6Rd3HOiURk+SGFjUlG15OTUt5JxEy6UKEOUsg5NPKO2LJLnC0znCge0A5oET4hJTg== X-Received: by 2002:a7b:c414:0:b0:3d6:ecc4:6279 with SMTP id k20-20020a7bc414000000b003d6ecc46279mr49831109wmi.27.1673356527307; Tue, 10 Jan 2023 05:15:27 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id o19-20020a05600c511300b003d9862ec435sm2783709wms.20.2023.01.10.05.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 05:15:26 -0800 (PST) Message-Id: <7eed8f353764774cc7335c51338db6cba14675aa.1673356522.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 10 Jan 2023 13:15:21 +0000 Subject: [PATCH v2 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. This causes confusion for some users [1]. Add a note about that in the 'Description' section, and mention the more robust alternative of using the branch's reflog. [1] https://lore.kernel.org/git/28ebf03b-e8bb-3769-556b-c9db17e43dbb@gmail.com/T/#m827179c5adcfb504d67f76d03c8e6942b55e5ed0 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