Re: [PATCH v2 3/6] worktree.txt: how to fix up after moving a worktree
- From
- Eric Sunshine <ericsunshine@gmail.com>
- Date
- Jan 18, 2016, 18:30 UTC
- Message-ID
- <CAPig+cRydwV4VMcfJ1ab50xumU=Ff4k13tN-R2VuEZhP3n=NjQ@mail.gmail.com>
- In-Reply-To
- <1453116094-4987-4-git-send-email-pclouds@gmail.com>
On Mon, Jan 18, 2016 at 6:21 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
> From: Eric Sunshine <ericsunshine@gmail.com>
Let's use sunshine@sunshineco.com instead.
If you want to keep this patch separate from the previous patch, then perhaps add a commit message here saying something like:
Following the example of af189b4 (Documentation/git-worktree:
split technical info from general description, 2015-07-06), keep the
high-level overview free of low-level details about updating
administrative files when moving a worktree, and instead mention
$GIT_DIR/worktrees/<id>/gitdir in the "DETAILS" section.> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Show 38 quoted lines
> --- > Documentation/git-worktree.txt | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt > index 4814f48..62c76c1 100644 > --- a/Documentation/git-worktree.txt > +++ b/Documentation/git-worktree.txt > @@ -32,9 +32,9 @@ The working tree's administrative files in the repository (see > `git worktree prune` in the main or any linked working tree to > clean up any stale administrative files. > > -If you move a linked working tree to another file system, or > -within a file system that does not support hard links, you need to update > -$GIT_DIR/worktrees/<id>/gitdir so that they do not get automatically pruned. > +If you move a linked working tree, you need to manually update the > +administrative files so that they do not get pruned automatically. See > +section "DETAILS" for more information. > > If a linked working tree is stored on a portable device or network share > which is not always mounted, you can prevent its administrative files from > @@ -135,6 +135,13 @@ thumb is do not make any assumption about whether a path belongs to > $GIT_DIR or $GIT_COMMON_DIR when you need to directly access something > inside $GIT_DIR. Use `git rev-parse --git-path` to get the final path. > > +If you move a linked working tree, you need to update the 'gitdir' file > +in the entry's directory. For example, if a linked working tree is moved > +to `/newpath/test-next` and its `.git` file points to > +`/path/main/.git/worktrees/test-next`, then update > +`/path/main/.git/worktrees/test-next/gitdir` to reference `/newpath/test-next` > +instead. > + > To prevent a $GIT_DIR/worktrees entry from being pruned (which > can be useful in some situations, such as when the > entry's working tree is stored on a portable device), add a file named > -- > 2.7.0.96.g5373197 >