git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Kristoffer Haugsbakk <code@khaugsbakk.name>
Cc: git@vger.kernel.org,
	 Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Subject: Re: [PATCH] checkout: refer to other-worktree branch, not ref
Date: Wed, 09 Oct 2024 11:46:17 -0700	[thread overview]
Message-ID: <xmqqh69lru6e.fsf@gitster.g> (raw)
In-Reply-To: <259fcbb61f13873421d50df77f151130fdbf0166.1728494795.git.code@khaugsbakk.name> (Kristoffer Haugsbakk's message of "Wed, 9 Oct 2024 19:27:58 +0200")

Kristoffer Haugsbakk <code@khaugsbakk.name> writes:

> Notes (series):
>     I also change “is holding” to “is using”.  This has plenty of
>     precedence:
>     
>     1. The code ultimately calls
>       `builtin/checkout.c:die_if_switching_to_a_branch_in_use` which says
>       that we die if the branch is “in use” by another worktree, just like
>       we do here for the new description string on
>       `--ignore-other-worktrees` (c.f. “holding the given ref”).
>     2. `man git checkout` uses the phrase “in use by” when talking about the
>        branch being checked out in another worktree.

Good to see an update is done with such an attention to detail.

A branch "in use" includes, but is not limited to, being checked
out.  For example, "git rebase" may first detach the HEAD when it
goes to work, but it fully intends to switch back to the branch it
rebased when it is done.  It does not want somebody else mucking
with the branch from other worktrees, so "checkout" or "switch"
would consider such a branch is "in use".

>  --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
> +	`git checkout` refuses when the wanted branch is already checked
> +	out by another worktree. This option makes it check the branch
> +	out anyway. In other words, the branch can be held by more than one
>  	worktree.

As you are updating the usage string, we may want to unify the use
of the same word, just like the original said "be held" here to
match "is holding" over there.  Perhaps

	... branch is already checked out or otherwise in use by
	another worktree. ... the branch can be in use by more than
	one worktree.

or something?

>  --overwrite-ignore::
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> index 9c30000d3af..c449558e663 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")),

Good.

>  		OPT_END()
>  	};
>  	struct option *newopts = parse_options_concat(prevopts, options);

Thanks.


  parent reply	other threads:[~2024-10-09 18:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09 17:27 [PATCH] checkout: refer to other-worktree branch, not ref Kristoffer Haugsbakk
2024-10-09 17:36 ` Kristoffer Haugsbakk
2024-10-09 18:46 ` Junio C Hamano [this message]
2024-10-10 18:23   ` Kristoffer Haugsbakk
2024-10-10 18:39 ` [PATCH v2] " kristofferhaugsbakk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqh69lru6e.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=code@khaugsbakk.name \
    --cc=git@vger.kernel.org \
    --cc=kristofferhaugsbakk@fastmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).