From b8139c8f4e761bd24f4ffc3170203e82c75165e2 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Thu, 10 Oct 2024 20:39:29 +0200 Subject: [PATCH] checkout: refer to other-worktree branch, not ref MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can only check out commits or branches, not refs in general. And the problem here is if another worktree is using the branch that we want to check out. Let’s be more direct and just talk about branches instead of refs. Also replace “be held” with “in use”. Further, “in use” is not restricted to a branch being checked out (e.g. the branch could be busy on a rebase), hence generalize to “or otherwise in use” in the option description. Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-checkout.txt | 8 ++++---- builtin/checkout.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 8bdfa54ab09b4c..bf26655764f33c 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -290,10 +290,10 @@ Note that this option uses the no overlay mode by default (see also `--overlay`), and currently doesn't support overlay mode. --ignore-other-worktrees:: - `git checkout` refuses when the wanted ref is already checked - out by another worktree. This option makes it check the ref - out anyway. In other words, the ref can be held by more than one - worktree. + `git checkout` refuses when the wanted branch is already checked + out or otherwise in use by another worktree. This option makes + it check the branch out anyway. In other words, the branch can + be in use by more than one worktree. --overwrite-ignore:: --no-overwrite-ignore:: diff --git a/builtin/checkout.c b/builtin/checkout.c index 9c30000d3afe28..c449558e663a34 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1716,7 +1716,7 @@ static struct option *add_common_switch_branch_options( N_("update ignored files (default)"), PARSE_OPT_NOCOMPLETE), OPT_BOOL(0, "ignore-other-worktrees", &opts->ignore_other_worktrees, - N_("do not check if another worktree is holding the given ref")), + N_("do not check if another worktree is using this branch")), OPT_END() }; struct option *newopts = parse_options_concat(prevopts, options);