From: Nguyễn Thái Ngọc Duy Date: Mon, 30 May 2016 10:49:38 GMT Subject: [PATCH v3 5/6] worktree: add "lock" command Message-ID: <20160530104939.28407-6-pclouds@gmail.com> In-Reply-To: <20160530104939.28407-1-pclouds@gmail.com> Helped-by: Eric Sunshine Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 28 +++++++++++++++----- builtin/worktree.c | 38 +++++++++++++++++++++++++++ contrib/completion/git-completion.bash | 5 +++- t/t2028-worktree-move.sh (new +x) | 48 ++++++++++++++++++++++++++++++++++ 4 files changed, 112 insertions(+), 7 deletions(-) create mode 100755 t/t2028-worktree-move.sh diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index 27feff6..6fca6cf 100644 --- 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 @@ -38,9 +39,8 @@ 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 -being pruned by creating a file named 'locked' alongside the other -administrative files, optionally containing a plain text reason that -pruning should be suppressed. See section "DETAILS" for more information. +being pruned by issuing the `git worktree lock` command, optionally +specifying `--reason` to explain why the working tree is locked. COMMANDS -------- @@ -61,6 +61,14 @@ each of the linked worktrees. The output details include if the worktree is bare, the revision currently checked out, and the branch currently checked out (or 'detached HEAD' if none). +lock:: + +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`. + prune:: Prune working tree information in $GIT_DIR/worktrees. @@ -110,6 +118,15 @@ OPTIONS --expire