git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: "Rubén Justo" <rjusto@gmail.com>
Cc: Git List <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 2/2] branch: error message checking out a branch in use
Date: Mon, 7 Aug 2023 17:34:28 -0400	[thread overview]
Message-ID: <ZNFjZD4ImMz2mnrT@nand.local> (raw)
In-Reply-To: <d217d15f-ddef-d9bf-07fa-464b4025ab3c@gmail.com>

On Mon, Aug 07, 2023 at 10:42:40PM +0200, Rubén Justo wrote:
> Let's update the error message we show when the user tries to check out
> a branch which is being used in another worktree, following the
> guideline reasoned in 4970bedef2 (branch: update the message to refuse
> touching a branch in-use, 2023-07-21).
>
> Signed-off-by: Rubén Justo <rjusto@gmail.com>
> ---
>  branch.c                | 2 +-
>  t/t2400-worktree-add.sh | 3 ++-
>  t/t3400-rebase.sh       | 2 +-
>  3 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/branch.c b/branch.c
> index 3e4684f79f..98c199f7b7 100644
> --- a/branch.c
> +++ b/branch.c
> @@ -838,7 +838,7 @@ void die_if_checked_out(const char *branch, int ignore_current_worktree)
>
>  		if (is_shared_symref(worktrees[i], "HEAD", branch)) {
>  			skip_prefix(branch, "refs/heads/", &branch);
> -			die(_("'%s' is already checked out at '%s'"),
> +			die(_("'%s' already used by worktree at '%s'"),

I wonder if "'%s' is already used by ..." (with the additional "is"
between the branch name and "already") would be clearer / more natural.

Thanks,
Taylor

  reply	other threads:[~2023-08-07 21:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 20:38 [PATCH 0/2] branch: update error messages Rubén Justo
2023-08-07 20:42 ` [PATCH 1/2] branch: error message deleting a branch in use Rubén Justo
2023-08-07 20:42 ` [PATCH 2/2] branch: error message checking out " Rubén Justo
2023-08-07 21:34   ` Taylor Blau [this message]
2023-08-07 22:49     ` Rubén Justo
2023-08-07 21:18 ` [PATCH 0/2] branch: update error messages Junio C Hamano

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=ZNFjZD4ImMz2mnrT@nand.local \
    --to=me@ttaylorr.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rjusto@gmail.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).