git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] branch: error message checking out a branch in use

From
Taylor Blau <me@ttaylorr.com>
Date
Aug 7, 2023, 21:34 UTC
Message-ID
<ZNFjZD4ImMz2mnrT@nand.local>
In-Reply-To
<d217d15f-ddef-d9bf-07fa-464b4025ab3c@gmail.com>
On Mon, Aug 07, 2023 at 10:42:40PM +0200, Rubén Justo wrote:
Show 22 quoted lines
> 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

Previous: Rubén JustoNext: Rubén Justo
Message 4 of 6 in “branch: update error messages”
  1. 0/2 branch: update error messagesRubén Justo, Aug 7, 2023
  2. 1/2 branch: error message deleting a branch in useRubén Justo, Aug 7, 2023
  3. 2/2 branch: error message checking out a branch in useRubén Justo, Aug 7, 2023
  4. Taylor BlauAug 7, 2023
  5. Rubén JustoAug 7, 2023
  6. Junio C HamanoAug 7, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.