From patchwork Tue Oct 10 11:01:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13415189 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 3FD30CD80A4 for ; Tue, 10 Oct 2023 11:01:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229958AbjJJLBk (ORCPT ); Tue, 10 Oct 2023 07:01:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbjJJLBi (ORCPT ); Tue, 10 Oct 2023 07:01:38 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 017F194 for ; Tue, 10 Oct 2023 04:01:35 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5B3175C0266; Tue, 10 Oct 2023 07:01:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 10 Oct 2023 07:01:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1696935693; x=1697022093; bh=8VgQhYRSrWg2F+BjQoc6Xn9wp b7HDIey92WmXZoA8Ks=; b=rKOnpZXAGxepm+h0L2cMIABskRDNL+R7KkFEapGQM VGOQpwtfFoOOTzVSTqXRLvfeYZPidGttBh7tU9of1S5f5tkv9JqBg/mIGSxO1Xka SBQvxxcemw6hwIRpNv6DFAaRTJf/G9KekpteWK6VTuT6mKH8e7aewxs6xb1eL1Aq R0yYLz+dOsQoEqNYqul+CUoQS76LLzwtOTMGxhxAkliygf80YBZWk6NVrJVimlPD 3ifVLT6MuHA0YV3A7PdBJvxuYGA2nZyvngk6LPvxmoBEwalbtd5RAXXMVlZ2dAKh fTQYgpyt9RgLJ+3v+w8tudT1Qz9rZrjwyKVyy4jUU/KQQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1696935693; x=1697022093; bh=8VgQhYRSrWg2F+BjQoc6Xn9wpb7HDIey92W mXZoA8Ks=; b=V3L058wwpIMdAdqdNJ6LS0k2RJwzjiiQwDKF4hW6RIW10DKLrwa Ps+mJKCZM4nM+FFv8mHW476dwfRhTRyNIHwRvcy0etn8bFVnusRx377vl80FTTo+ xnFMm62r0xKF3zTqZFR+Uz1tn7tUzTrrttjxiya02Q0G/OWTK3jWC6ghZlcRuvy6 1szNK2gElXclKjQY1DHPe/rGP4jsbZAgctgb8fTwL8KPrHSyBLs9rNtX+J5J2Btg gfyef81dN/rPSjBS1wpLcQJb03S3us5ba6tNwIY6vmw/a4XjDMrP64q4lbgpiJ++ Os+7yvhoadwtEAjxVYB0E2MM06nRiZm9M7g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrheehgdeffecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggusehgtderredttddvnecuhfhrohhmpefrrghtrhhitghk ucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrhhnpe eugfeutdeuieehteelveegudejkeejheeljeejhffhgffhvefgkeeukeejtdeijeenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesphhksh drihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 10 Oct 2023 07:01:31 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id e90df579 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 10 Oct 2023 11:01:28 +0000 (UTC) Date: Tue, 10 Oct 2023 13:01:26 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Johannes Schindelin Subject: [PATCH] doc/git-worktree: mention "refs/rewritten" as per-worktree refs Message-ID: <985ac850eb6e60ae76601acc8bfbcd56f99348b4.1696935657.git.ps@pks.im> MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Some references are special in the context of worktrees as they are considered to be per-worktree instead of shared across all of the worktrees. Most importantly, this includes "refs/worktree/" that have explicitly been designed such that users can create per-woorktree refs. But there are also special references that have an associated meaning like "refs/bisect/", which is used to track state of git-bisect(1). These special per-worktree references are documented in git-worktree(1), but one instance is missing. In a9be29c9817 (sequencer: make refs generated by the `label` command worktree-local, 2018-04-25), we have converted "refs/rewritten/" to be a per-worktree reference as well. These references are used by our sequencer infrastructure to generate labels for rebased commits. So in order to allow for multiple concurrent rebases to happen in different worktrees, these references need to be tracked per worktree. We forgot to update our documentation to mention these new per-worktree references, which is fixed by this patch. Signed-off-by: Patrick Steinhardt --- Documentation/git-worktree.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index a4fbf5e838..93d76f5d66 100644 --- a/Documentation/git-worktree.txt +++ b/Documentation/git-worktree.txt @@ -286,7 +286,8 @@ rules and how to access refs of one worktree from another. In general, all pseudo refs are per-worktree and all refs starting with `refs/` are shared. Pseudo refs are ones like `HEAD` which are directly under `$GIT_DIR` instead of inside `$GIT_DIR/refs`. There are exceptions, -however: refs inside `refs/bisect` and `refs/worktree` are not shared. +however: refs inside `refs/bisect`, `refs/worktree` and `refs/rewritten` are +not shared. Refs that are per-worktree can still be accessed from another worktree via two special paths, `main-worktree` and `worktrees`. The former gives @@ -363,8 +364,8 @@ linked worktree `git rev-parse --git-path HEAD` returns `/path/other/test-next/.git/HEAD` or `/path/main/.git/HEAD`) while `git rev-parse --git-path refs/heads/master` uses `$GIT_COMMON_DIR` and returns `/path/main/.git/refs/heads/master`, -since refs are shared across all worktrees, except `refs/bisect` and -`refs/worktree`. +since refs are shared across all worktrees, except `refs/bisect`, +`refs/worktree` and `refs/rewritten`. See linkgit:gitrepository-layout[5] for more information. The rule of thumb is do not make any assumption about whether a path belongs to