Skip to content

Commit 8b3aa36

Browse files
pks-tgitster
authored andcommitted
doc/git-worktree: mention "refs/rewritten" as per-worktree refs
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 a9be29c (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 43c8a30 commit 8b3aa36

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Documentation/git-worktree.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ rules and how to access refs of one worktree from another.
286286
In general, all pseudo refs are per-worktree and all refs starting with
287287
`refs/` are shared. Pseudo refs are ones like `HEAD` which are directly
288288
under `$GIT_DIR` instead of inside `$GIT_DIR/refs`. There are exceptions,
289-
however: refs inside `refs/bisect` and `refs/worktree` are not shared.
289+
however: refs inside `refs/bisect`, `refs/worktree` and `refs/rewritten` are
290+
not shared.
290291

291292
Refs that are per-worktree can still be accessed from another worktree via
292293
two special paths, `main-worktree` and `worktrees`. The former gives
@@ -363,8 +364,8 @@ linked worktree `git rev-parse --git-path HEAD` returns
363364
`/path/other/test-next/.git/HEAD` or `/path/main/.git/HEAD`) while `git
364365
rev-parse --git-path refs/heads/master` uses
365366
`$GIT_COMMON_DIR` and returns `/path/main/.git/refs/heads/master`,
366-
since refs are shared across all worktrees, except `refs/bisect` and
367-
`refs/worktree`.
367+
since refs are shared across all worktrees, except `refs/bisect`,
368+
`refs/worktree` and `refs/rewritten`.
368369

369370
See linkgit:gitrepository-layout[5] for more information. The rule of
370371
thumb is do not make any assumption about whether a path belongs to

0 commit comments

Comments
 (0)