From patchwork Fri Apr 14 17:58:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13211889 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 E1C30C77B73 for ; Fri, 14 Apr 2023 17:58:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229790AbjDNR6p (ORCPT ); Fri, 14 Apr 2023 13:58:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbjDNR6n (ORCPT ); Fri, 14 Apr 2023 13:58:43 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D6D37DB6 for ; Fri, 14 Apr 2023 10:58:42 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id e16so5089437wra.6 for ; Fri, 14 Apr 2023 10:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681495120; x=1684087120; 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=bv0m5He2+t546XYlCCWfavvHgOUqvZ9+YAQRmB1nnwE=; b=R33Y7EOP/XNMqkICfHA1M2caRoz6vmZ6rf4aDAjXOtdtuTfc8Y/zm3CnwChzHj/nQO eNcr8Yb0D5fgWZSJNartrwMINxuMlc98v76hrLkLmalg5z2AgeDg7Hx+xBriRQu98XCL pHjmXPKB67rxXeDmHF+J97bocrYL4WnEQtiOaTFR1oHsRxGogHx0G7nIsz1LfQG6Qcnu 0gSMlPvzbhH72MfP0/FEnSKf8+DMjyQkN15rE6jzL/yqtoSTluSj9JFpQwctBBiQf1Q0 SN9yiaoE5uGgMm0OGXzOijESeSfeew8tQuvo7DH1TQLPYAL7HOFVSV6yufLIKUS4uQaO clGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681495120; x=1684087120; 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=bv0m5He2+t546XYlCCWfavvHgOUqvZ9+YAQRmB1nnwE=; b=diCK/RmMQeBw2eq/MWG7gyWUJVIfXA8qinoN6r3iOQdMtFFr534qMxDfutoi5DNI7A yW0VEpZw7XyLKh1xtyb/S55U6OwvD4Ej3ZK/hMWOlSYsI2rvMeN+ElA6IEGPpfD5C7Ct h1YToIRfdx1PlpIZgv1QDiq9OE9KuVnTlzbAjo2+ozfc3AMmxT27NubkpeL7vfBkpUui cqMzU1/YHoFC+SjWMy9+SN4bufsaTvEw8gRLNfjz4fJxRcP61EJNX3pbYqHG/B2InOCp h1vuuy12zBxQBaLOt/Dt654mklWvwrcN2UZDpUYft+SZ0Vr3Gis7B2DOV9IA9IwJcRsL UYsw== X-Gm-Message-State: AAQBX9cQMow1+n0K38moDKpeYzrpEkaGb7kGoo2MVw0uYB5jSsmOeBmP UkIweviIZznkJo0uTqlrQ3JCbUr/9cM= X-Google-Smtp-Source: AKy350ZmsYy1Cbxp9JbPcdq25vVWmVE2/SumU95q0Exk8BUlLJm6H9v/s/C5sQFJ0E2+kmIdj/RNqQ== X-Received: by 2002:adf:e98f:0:b0:2de:e7c3:1663 with SMTP id h15-20020adfe98f000000b002dee7c31663mr5032417wrm.10.1681495120522; Fri, 14 Apr 2023 10:58:40 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z17-20020adfe551000000b002f7394e7c01sm1714412wrm.104.2023.04.14.10.58.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 10:58:40 -0700 (PDT) Message-Id: <66c7e514157f3c8220eb994cea7c4659d5241042.1681495119.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 14 Apr 2023 17:58:34 +0000 Subject: [PATCH 1/5] revisions.txt: document more special refs Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , Johannes Schindelin , Philippe Blain , Philippe Blain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Philippe Blain From: Philippe Blain Some special refs, namely HEAD, FETCH_HEAD, ORIG_HEAD, MERGE_HEAD and CHERRY_PICK_HEAD, are mentioned and described in 'gitrevisions', but some others, namely REBASE_HEAD, REVERT_HEAD, and BISECT_HEAD, are not. Add a small description of these special refs. Signed-off-by: Philippe Blain --- Documentation/revisions.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt index 9aa58052bc7..98b8f89bc8d 100644 --- a/Documentation/revisions.txt +++ b/Documentation/revisions.txt @@ -32,8 +32,8 @@ characters and to avoid word splitting. first match in the following rules: . If '$GIT_DIR/' exists, that is what you mean (this is usually - useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD`, `MERGE_HEAD` - and `CHERRY_PICK_HEAD`); + useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD`, `MERGE_HEAD`, + `REBASE_HEAD`, `REVERT_HEAD`, `CHERRY_PICK_HEAD` and `BISECT_HEAD`); . otherwise, 'refs/' if it exists; @@ -55,8 +55,15 @@ 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 when you run `git merge`. +`REBASE_HEAD`, during a rebase, records the commit at which the +operation is currently stopped, either because of conflicts or an `edit` +command in an interactive rebase. +`REVERT_HEAD` records the commit which you are reverting when you +run `git revert`. `CHERRY_PICK_HEAD` records the commit which you are cherry-picking when you run `git cherry-pick`. +`BISECT_HEAD` records the current commit to be tested when you +run `git bisect --no-checkout`. + Note that any of the 'refs/*' cases above may come either from the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file. From patchwork Fri Apr 14 17:58:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13211891 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 6446FC77B71 for ; Fri, 14 Apr 2023 17:58:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230060AbjDNR6u (ORCPT ); Fri, 14 Apr 2023 13:58:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbjDNR6p (ORCPT ); Fri, 14 Apr 2023 13:58:45 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81C4E7D91 for ; Fri, 14 Apr 2023 10:58:43 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id v20-20020a05600c471400b003ed8826253aso5517253wmo.0 for ; Fri, 14 Apr 2023 10:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681495121; x=1684087121; 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=OXZgtomDUzZgqaysrY3KHewgOZIRwk9evIrjx/Ge6ec=; b=LjvOZ2A/kO643jsuJMZGrLhw6WRDZHM0mgy3t3GqWUe15KN7iVi6Rs+L+j91zhsRo2 vdU/hMfyWugRMvJcZIerI6nS7ZeV6y0A6SqVM0YwZqVzExWLHK5YCrQThqL0VDp7/JzY 1nc1br359RmIWFhqe7aVFd9bSttOFVJ/ovMFw8h8SeowWLgWl7P0CTq8HNP+fLXPmSH9 rNdeyaNmC1yFCI6Ol9OyytRaOBSjpqfQ95AzB65ODd5sJRKZTn35sOaqsv9tQT8gs8T8 O+ptRnEi5pCuuD1+e/92FGo4GVg7qh6cyvEZi30L05VOEow8UOpwrqMMZeLopXL9W5Q0 /uDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681495121; x=1684087121; 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=OXZgtomDUzZgqaysrY3KHewgOZIRwk9evIrjx/Ge6ec=; b=OY5QoGwIM+t6a39WdTvTRImzpm6sqKruPBiKvYYjQTXlkvLirx/wbxk8u1GhxOXyRH lEziCejU5Z7Y+NyJr7jmQO4/j8x6XHWm1tAv6dKV1gkHVM9mbgZVy5D7O6ncX90V+Hlk VAoV71FCXpnfDTWZWAiuBXigvSTZyHMwQENqq0khbwAP5cQHcmA27ezzdUug5VxjKF5c Nsj/GkzKBOlwk3who0Zftqc6vSMorPs0KzRWL2XhTa0bqueNXRYn9Eop6FLk4EiPEaEq +DzevQsmuMAyEKW5vICjStiuo7W+rf+8FG4k7tvD7/Bj1E6nO0ftaSDMsofy6yE59tQC Ekwg== X-Gm-Message-State: AAQBX9fmufGTW4W6K8hc4Ik2fx2xIPKeKMbpW0FIV4GX29CoQN2aa9UH +3je/EecByGFM31u1boIHTKxI8MTJC4= X-Google-Smtp-Source: AKy350YwzBYZ8yJnualqce+6D5pwXIRswk/iMewQiT99wZx3KnxzviE83mP821ghwyd/MIwQ5lJ8Gw== X-Received: by 2002:a7b:cbcc:0:b0:3ed:eab9:976a with SMTP id n12-20020a7bcbcc000000b003edeab9976amr4624311wmi.5.1681495121262; Fri, 14 Apr 2023 10:58:41 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id p6-20020a1c7406000000b003ed2c0a0f37sm4777362wmc.35.2023.04.14.10.58.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 10:58:40 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Fri, 14 Apr 2023 17:58:35 +0000 Subject: [PATCH 2/5] completion: complete REVERT_HEAD and BISECT_HEAD Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , Johannes Schindelin , Philippe Blain , Philippe Blain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Philippe Blain From: Philippe Blain The pseudorefs REVERT_HEAD and BISECT_HEAD are not suggested by the __git_refs function. Add them there. Signed-off-by: Philippe Blain --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index dc95c34cc85..bcda376735c 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -767,7 +767,7 @@ __git_refs () track="" ;; *) - for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD CHERRY_PICK_HEAD; do + for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD CHERRY_PICK_HEAD REVERT_HEAD BISECT_HEAD; do case "$i" in $match*|$umatch*) if [ -e "$dir/$i" ]; then From patchwork Fri Apr 14 17:58:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13211890 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 262F1C77B71 for ; Fri, 14 Apr 2023 17:58:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230054AbjDNR6s (ORCPT ); Fri, 14 Apr 2023 13:58:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbjDNR6p (ORCPT ); Fri, 14 Apr 2023 13:58:45 -0400 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 B7DF87DB6 for ; Fri, 14 Apr 2023 10:58:43 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id k27-20020a05600c1c9b00b003f0a9f022beso2398546wms.1 for ; Fri, 14 Apr 2023 10:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681495122; x=1684087122; 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=2bAs+0aOGHBLkcL5yxlo6xyrRuKcHb3n8K90rZopGoc=; b=ESw/GZqgOMRaUBo+oBfCHXH3NNMkctf3ZgTCsXbBB5tqCktWHU0ffqtddr6R0CG10K jBaKRFyxejO8c9Rd97j1yR6qABQzpd84bZWbmXtXe4QL16gnV2h3igls8EE8sLRTtkCO NjaYea56V8eCtvsfQ4UwLVXOhe5wX1AkH2ic5h7F4Wlk/n6VoR5ZcL6bVgCo54dEpbPc P2oysP7AQYy1rvUacNuARl1sqspbXjNebnJPAhGxdMw+5bAxNM5gd/GyAAVBRK141x0F E0ldU/41Ne+1EboWjGtiI3TdATEzl+0lAJrLzbFmlEueVf7pfbPygGqPz0Eq6+KfShAU hMbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681495122; x=1684087122; 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=2bAs+0aOGHBLkcL5yxlo6xyrRuKcHb3n8K90rZopGoc=; b=GYIEysYA2ALw5IUaHaNJJjZLccEejNt2pw+JioeRXDXaSJCKzLHQV1emYVvIRcKA0U i7LGP8jabFlZWA88wLYOefr2jDH3feVBOHI1l+DP6CQnv9F5tXuDD91HFKWFF+67gj5a 8532o0v09/cjEdAwHq6KQpE25LgkLWymLZ7YJzsrex7tmhIhTINXI1iEe/obptmGLWbE LDhmfCuyJUAb5UsSFlQM4GCSncQkSRxvhp4R1XbZku+ojUrNblW8nZXJyaJqOH1K5Hrq 88Fdxh2NGnv6PBvSj/CaQiGhcTQOHawjL91FypOtJqpwj3Rqn0jaTr/Ja+iHJ+K9j6nQ yiIw== X-Gm-Message-State: AAQBX9eG0CU5b7DacIdzIpwpYR5WHlVIz0ENcsovcwNf1n1RidQZeLQg Eb7159W+leKJ7aYmj6/6qv9C0ibNmho= X-Google-Smtp-Source: AKy350Z4DIN85EHUlGOXE5dPfvRWz5TYt9O/HUrSga6aGRKxPmaJba+3s6BS80DpQh/wM4xLCWGVlg== X-Received: by 2002:a1c:7510:0:b0:3ee:289a:43a7 with SMTP id o16-20020a1c7510000000b003ee289a43a7mr5161227wmc.22.1681495121882; Fri, 14 Apr 2023 10:58:41 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id o8-20020a05600c378800b003ed2433aa4asm4760198wmr.41.2023.04.14.10.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 10:58:41 -0700 (PDT) Message-Id: <62b68829c5aeaa28a79192b55058e87a0ef72816.1681495119.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 14 Apr 2023 17:58:36 +0000 Subject: [PATCH 3/5] git-merge.txt: modernize word choice in "True merge" section Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , Johannes Schindelin , Philippe Blain , Philippe Blain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Philippe Blain From: Philippe Blain The "True merge" section of the 'git merge' documentation mentions that in case of conflicts, the conflicted working tree files contain "the result of the "merge" program". This probably refers to RCS' 'merge' program, which is mentioned further down under "How conflicts are presented". Since it is not clear at that point of the document which program is referred to, and since most modern readers probably do not relate to RCS anyway, let's just write "the merge operation" instead. Signed-off-by: Philippe Blain --- Documentation/git-merge.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index 0aeff572a59..23aefe28851 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -194,7 +194,7 @@ happens: versions: stage 1 stores the version from the common ancestor, stage 2 from `HEAD`, and stage 3 from `MERGE_HEAD` (you can inspect the stages with `git ls-files -u`). The working - tree files contain the result of the "merge" program; i.e. 3-way + tree files contain the result of the merge operation; i.e. 3-way merge results with familiar conflict markers `<<<` `===` `>>>`. 5. No other changes are made. In particular, the local modifications you had before you started merge will stay the From patchwork Fri Apr 14 17:58:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13211893 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 72053C77B71 for ; Fri, 14 Apr 2023 17:59:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230133AbjDNR67 (ORCPT ); Fri, 14 Apr 2023 13:58:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230011AbjDNR6q (ORCPT ); Fri, 14 Apr 2023 13:58:46 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88A6383CB for ; Fri, 14 Apr 2023 10:58:44 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id q6so6892933wrc.3 for ; Fri, 14 Apr 2023 10:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681495123; x=1684087123; 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=zzM/60mSsNR0KJGFhVd8L6Cxs85i7APO+rqheyEtKZg=; b=XFTz5SkMt1o7//p+xxYXwxktA2TjYMr3X8mZv/SNaicz7vZpOochoeLzcRruTzOto8 i2HBsZWe6ASq5tu4JaCeawYWCoB90BiS2B7A0IXhQqFtP34wtC2jcsusi5hL4PMRY8uK QL0IsBUhQ4OtOnCYJZ/fC+lHdlshuWgtRRdpZGhK1Yfml40Yd1YWK3x/WA6RHfjlFj/N xaTE4G7oDDW/KMO5UOipXqGzanAVzu3V3hCpRC+MMkDxwJqExSCxmOdUzY5itoYfuzUN /Xl4lrytlwKyrDBFhU5Uqmov9eVeyRPRJ1Ac2ce8p0oSdu9Cr4497t9a54doxFBZYXep +cEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681495123; x=1684087123; 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=zzM/60mSsNR0KJGFhVd8L6Cxs85i7APO+rqheyEtKZg=; b=Rbj1JkQ0MY4iNPTHDqiRegwRTWfe4G/M1MZH0GThG9Cd53+buztWjPodKaRJLvQpHk izAEA3chG9Zn3SWVnowiqzFCYENBWKVlhhG3b7XSsf7iYAa4vtXKKHhC2wuC2pL4AEAu 06xUVIm4nTaL8d0+mlRJDCwJkeqlvimwYhh6SD9ZJtpFYL8ZNIhNPserFCAN9yPf27Ik RE3FfgIfrtKigMFAhYTRvhO2wiD5LT3uAj6fE4l86rWmyZGO505/9AlDerFpU3DxEpq9 nRlVxUtYine9nfDRE0P4/On/IF6wgxwyOEfW9HQUX7By17PiGxuUgeH9T5f9nhvvYode YWAw== X-Gm-Message-State: AAQBX9dGHLIkjcEjXw45OStLrXtx4J931KhMU7UGumJL4gu5PcnfRx5f dxNF8vNt8n+EchGIE71lY3+CBoJKWSY= X-Google-Smtp-Source: AKy350bfarretQ65YLVO5valisWdUAJnlh0xTKS8YVIGItItFyiMyNcnv5rc/SPyHup7cMZUw87V5g== X-Received: by 2002:a5d:6291:0:b0:2f4:215a:98c5 with SMTP id k17-20020a5d6291000000b002f4215a98c5mr4927555wru.70.1681495122737; Fri, 14 Apr 2023 10:58:42 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id w13-20020adfec4d000000b002efb6e0c495sm4011251wrn.91.2023.04.14.10.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 10:58:42 -0700 (PDT) Message-Id: <0cdd4ab3d739e07357ea9efef2cdece633db6ebb.1681495119.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 14 Apr 2023 17:58:37 +0000 Subject: [PATCH 4/5] Documentation: document AUTO_MERGE Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , Johannes Schindelin , Philippe Blain , Philippe Blain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Philippe Blain From: Philippe Blain Since 5291828df8 (merge-ort: write $GIT_DIR/AUTO_MERGE whenever we hit a conflict, 2021-03-20), when using the 'ort' merge strategy, the special ref AUTO_MERGE is written when a merge operation results in conflicts. This ref points to a tree recording the conflicted state of the working tree and is very useful during conflict resolution. However, this ref is not documented. Add some documentation for AUTO_MERGE in git-diff(1), git-merge(1), gitrevisions(7) and in the user manual. In git-diff(1), mention it at the end of the description section, when we mention that the command also accepts trees instead of commits, and also add an invocation to the "Various ways to check your working tree" example. In git-merge(1), add a step to the list of things that happen "when it is not obvious how to reconcile the changes", under the "True merge" secion. Also mention AUTO_MERGE in the "How to resolve conflicts" section, when mentioning 'git diff'. In gitrevisions(7), add a mention of AUTO_MERGE along with the other special refs. In the user manual, add a paragraph describing AUTO_MERGE to the "Getting conflict-resolution help during a merge" section, and include an example of a 'git diff AUTO_MERGE' invocation for the example conflict used in that section. Note that for uniformity we do not use backticks around AUTO_MERGE here since the rest of the document does not typeset special refs differently. Closes: https://github.com/gitgitgadget/git/issues/1471 Signed-off-by: Philippe Blain --- Documentation/git-diff.txt | 8 +++++++- Documentation/git-merge.txt | 9 +++++++-- Documentation/revisions.txt | 6 +++++- Documentation/user-manual.txt | 27 +++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt index 52b679256c4..a85cc756ebc 100644 --- a/Documentation/git-diff.txt +++ b/Documentation/git-diff.txt @@ -102,7 +102,11 @@ If --merge-base is given, use the merge base of the two commits for the Just in case you are doing something exotic, it should be noted that all of the in the above description, except in the `--merge-base` case and in the last two forms that use `..` -notations, can be any . +notations, can be any . A tree of interest is the one pointed to +by the special ref `AUTO_MERGE`, which is written by the 'ort' merge +strategy upon hitting merge conflicts (see linkgit:git-merge[1]). +Comparing the working tree with `AUTO_MERGE` shows changes you've made +so far to resolve conflicts (see the examples below). For a more complete list of ways to spell , see "SPECIFYING REVISIONS" section in linkgit:gitrevisions[7]. @@ -152,6 +156,7 @@ Various ways to check your working tree:: $ git diff <1> $ git diff --cached <2> $ git diff HEAD <3> +$ git diff AUTO_MERGE <4> ------------ + <1> Changes in the working tree not yet staged for the next commit. @@ -159,6 +164,7 @@ $ git diff HEAD <3> would be committing if you run `git commit` without `-a` option. <3> Changes in the working tree since your last commit; what you would be committing if you run `git commit -a` +<4> Changes in the working tree you've made to resolve conflicts so far. Comparing with arbitrary commits:: + diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index 23aefe28851..3f61389c1c2 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -196,7 +196,11 @@ happens: can inspect the stages with `git ls-files -u`). The working tree files contain the result of the merge operation; i.e. 3-way merge results with familiar conflict markers `<<<` `===` `>>>`. -5. No other changes are made. In particular, the local +5. A special ref `AUTO_MERGE` is written, pointing to a tree corresponding + to the current content of the working tree (including conflict markers). + Note that this ref is only written when the 'ort' merge strategy + is used (the default). +6. No other changes are made. In particular, the local modifications you had before you started merge will stay the same and the index entries for them stay as they were, i.e. matching `HEAD`. @@ -336,7 +340,8 @@ You can work through the conflict with a number of tools: * Look at the diffs. `git diff` will show a three-way diff, highlighting changes from both the `HEAD` and `MERGE_HEAD` - versions. + versions. `git diff AUTO_MERGE` will show what changes you've + made so far to resolve conlicts. * Look at the diffs from each branch. `git log --merge -p ` will show diffs first for the `HEAD` version and then the diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt index 98b8f89bc8d..b42a2bb30a5 100644 --- a/Documentation/revisions.txt +++ b/Documentation/revisions.txt @@ -33,7 +33,8 @@ characters and to avoid word splitting. . If '$GIT_DIR/' exists, that is what you mean (this is usually useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD`, `MERGE_HEAD`, - `REBASE_HEAD`, `REVERT_HEAD`, `CHERRY_PICK_HEAD` and `BISECT_HEAD`); + `REBASE_HEAD`, `REVERT_HEAD`, `CHERRY_PICK_HEAD`, `BISECT_HEAD` + and `AUTO_MERGE`); . otherwise, 'refs/' if it exists; @@ -64,6 +65,9 @@ run `git revert`. when you run `git cherry-pick`. `BISECT_HEAD` records the current commit to be tested when you run `git bisect --no-checkout`. +`AUTO_MERGE` records a tree object corresponding to the state the +'ort' merge strategy wrote to the working tree when a merge operation +resulted in conflicts. + Note that any of the 'refs/*' cases above may come either from the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file. diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index dc9c6a663a9..99e5f652e92 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -1343,6 +1343,33 @@ $ git diff -3 file.txt # diff against stage 3 $ git diff --theirs file.txt # same as the above. ------------------------------------------------- +When using the 'ort' merge strategy (the default), before updating the working +tree with the result of the merge, Git writes a special ref named AUTO_MERGE +reflecting the state of the tree it is about to write. Conflicted paths that +could not be automatically merged are written to this tree with conflict +markers, just as in the working tree. AUTO_MERGE can thus be used with +linkgit:git-diff[1] to show the changes you've made so far to resolve +conflicts. Using the same example as above, after resolving the conflict we +get: + +------------------------------------------------- +$ git diff AUTO_MERGE +diff --git a/file.txt b/file.txt +index cd10406..8bf5ae7 100644 +--- a/file.txt ++++ b/file.txt +@@ -1,5 +1 @@ +-<<<<<<< HEAD:file.txt +-Hello world +-======= +-Goodbye +->>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086:file.txt ++Goodbye world +------------------------------------------------- + +Notice that the diff shows we deleted the conflict markers and both versions, +and wrote "Goodbye world" instead. + The linkgit:git-log[1] and linkgit:gitk[1] commands also provide special help for merges: From patchwork Fri Apr 14 17:58:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13211892 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 224B2C77B72 for ; Fri, 14 Apr 2023 17:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230103AbjDNR65 (ORCPT ); Fri, 14 Apr 2023 13:58:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbjDNR6q (ORCPT ); Fri, 14 Apr 2023 13:58:46 -0400 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 5067C83ED for ; Fri, 14 Apr 2023 10:58:45 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id bi22-20020a05600c3d9600b003f0ad935166so2891953wmb.4 for ; Fri, 14 Apr 2023 10:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681495123; x=1684087123; 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=dL8RywK3IbRfheNuCT7+B/rpq26oTVcacZsRBOSlJMo=; b=sdzcWyDx7MBi5FZLAkAhxd616ouI1TilYvdYlyI0TotdCcusiVXLx/VnQFXYaPxwWR Lwjkc+wNWetT4zBApe7u/gdu/lqPtFtH0cO3plp2QLg9gjnrXQkbGdpPAwe2+ihI+WO1 yXwNgA5ANeOm0nD11o+en1IPYOKaRzVlcbOUmZwESQeOi9WmW99SWA91OuLwOcXU2c1f zVcI6TGZqosPe92LszB5wnipL579I+GaSWDg5HNANNN0jnPwVHjI3jKUV/2lDiRM2i05 N8HekyC9IK1y0oLB/VrAVRhTdJTslvagzrIoKJMYLNKpzw1Gt4CUs9jwyyqCRj+M7vTo uuVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681495123; x=1684087123; 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=dL8RywK3IbRfheNuCT7+B/rpq26oTVcacZsRBOSlJMo=; b=AAD0qCw9Yxpx41hR7wfpRNwY5BT8LIqBgSbAEM9QFWm3l6bA1eG8Fr34OkR6rLn8eH bTyaPSo0bgXL63f+GiPJhjq6zKqowrD9nd4oHZ6lJGK4PAefOdDsV+l7VArfFdJpKsVu XJDYZCohg2egAVANpis2Dz6DAnoa733e+fInJet/WOqsRsd32EgYa0H8xIJ7vm7VyKSJ uxIsTCcOSU9ymF0OuSZKD7t2m17liVMAzeyhDz3gZcQSfasNRCsx7dv7HBzvTZqyEz1C ahZu9H91a9OQslzLqMm1Y+nhs/+rVqLb26II9QbhYGdeRnzcbcAt4+GFCZECm4oWBfqO fA7A== X-Gm-Message-State: AAQBX9eRRcv8FnZODn092a3eHmYfLJ+k9JfbNj8jdbydk5OPz6w8GSQR PcyzuxPCA5ZDHmEvpgkzOZmtql/SwNs= X-Google-Smtp-Source: AKy350bKXqlfRlsXaOgSM0yeq2tXKC2okaD6i+hE8zn7pW6YU7U2R6UhMmzgxSroU/3NAaARk4U6nw== X-Received: by 2002:a7b:cd86:0:b0:3ee:555:ea60 with SMTP id y6-20020a7bcd86000000b003ee0555ea60mr5454050wmj.8.1681495123527; Fri, 14 Apr 2023 10:58:43 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id c8-20020a05600c0a4800b003ee5fa61f45sm8595737wmq.3.2023.04.14.10.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 10:58:43 -0700 (PDT) Message-Id: <88cc7a80f313b5511e62d4df064887cc709f76ca.1681495119.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 14 Apr 2023 17:58:38 +0000 Subject: [PATCH 5/5] completion: complete AUTO_MERGE Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , Johannes Schindelin , Philippe Blain , Philippe Blain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Philippe Blain From: Philippe Blain The pseudoref AUTO_MERGE is documented since the previous commit. To make it easier to use, let __git_refs in the Bash completion code complete it. Signed-off-by: Philippe Blain --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index bcda376735c..945d2543b07 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -767,7 +767,7 @@ __git_refs () track="" ;; *) - for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD CHERRY_PICK_HEAD REVERT_HEAD BISECT_HEAD; do + for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD CHERRY_PICK_HEAD REVERT_HEAD BISECT_HEAD AUTO_MERGE; do case "$i" in $match*|$umatch*) if [ -e "$dir/$i" ]; then