From: Stephen Manz via GitGitGadget Date: Thu, 08 Jul 2021 15:50:43 GMT Subject: [PATCH v2 3/3] worktree: teach `add` to accept --reason with --lock Message-ID: <4d17b31921ac775ad512d4de094b4718f5dd2eb3.1625759443.git.gitgitgadget@gmail.com> In-Reply-To: From: Stephen Manz The default reason stored in the lock file, "added with --lock", is unlikely to be what the user would have given in a separate `git worktree lock` command. Allowing `--reason` to be specified along with `--lock` when adding a working tree gives the user control over the reason for locking without needing a second command. Signed-off-by: Stephen Manz --- Documentation/git-worktree.txt | 4 ++-- builtin/worktree.c | 7 +++++++ t/t2400-worktree-add.sh | 13 +++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index f1bb1fa5f5a..720663746ba 100644 --- a/Documentation/git-worktree.txt +++ b/Documentation/git-worktree.txt @@ -9,7 +9,7 @@ git-worktree - Manage multiple working trees SYNOPSIS -------- [verse] -'git worktree add' [-f] [--detach] [--checkout] [--lock] [-b ] [] +'git worktree add' [-f] [--detach] [--checkout] [--lock [--reason ]] [-b ] [] 'git worktree list' [--porcelain] 'git worktree lock' [--reason ] 'git worktree move' @@ -242,7 +242,7 @@ With `list`, annotate missing working trees as prunable if they are older than `