From: Eric Sunshine Date: Mon, 16 May 2016 00:09:00 GMT Subject: Re: [PATCH 4/5] worktree: add "lock" command Message-ID: In-Reply-To: <20160510141729.23063-4-pclouds@gmail.com> On Tue, May 10, 2016 at 10:17 AM, Nguyễn Thái Ngọc Duy wrote: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt > @@ -11,6 +11,7 @@ SYNOPSIS > [verse] > 'git worktree add' [-f] [--detach] [--checkout] [-b ] [] > 'git worktree list' [--porcelain] > +'git worktree lock' [--reason ] > 'git worktree prune' [-n] [-v] [--expire ] > > DESCRIPTION This forgets to update the paragraph in DESCRIPTION which currently talks about manually creating the 'locked' file. Perhaps it can be rewritten like this: 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 being pruned by issuing the `git worktree lock` command, optionally specifying `--reason` to explain why the working tree is locked. The DETAILS section might also need a small update. It currently says: ...add a file named 'locked'... but perhaps it should instead say: ...use the `git worktree lock` command, which adds a file named `locked`,... > @@ -61,6 +62,12 @@ each of the linked worktrees. The output details include if the worktree is > +lock:: > + > +When a worktree is locked, it cannot be pruned, moved or deleted. For > +example, if the worktree is on portable device that is not available > +when "git worktree " is executed. The really important reason for locking a worktree is to prevent its administrative files from being pruned *automatically*. This description doesn't properly emphasize that point. Also, bc48328 (Documentation/git-worktree: consistently use term "linked working tree", 2015-07-20) comprehensively replaced the term "worktree" with "working tree" and, although some new instances slipped in with bb9c03b (worktree: add 'list' command, 2015-10-08), we should probably avoid adding more. Perhaps the description of "lock" can be rewritten like this: If a working tree is on a portable device or network share which is not always mounted, lock it to prevent its administrative files from being pruned automatically. This also prevents it from being moved or deleted. Optionally, specify a reason for the lock with `--reason`. I guess preventing it from being deleted when locked is a safety measure? > @@ -110,6 +117,9 @@ OPTIONS > --expire