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

Re: [PATCH] checkout: refer to other-worktree branch, not ref

From
KHKristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Date
Oct 10, 2024, 18:23 UTC
Message-ID
<23f2006d-145f-4cea-ab36-859eb2e87489@app.fastmail.com>
In-Reply-To
<xmqqh69lru6e.fsf@gitster.g>
On Wed, Oct 9, 2024, at 20:46, Junio C Hamano wrote:
Show 6 quoted lines
> 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".

I did not know that checkout and friends respect branches which are preocuppied with (e.g.) a rebase. But I’m glad to learn that they do. :)

Show 19 quoted lines
>
>>  --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?
Nice. I like it.
-- 
Kristoffer Haugsbakk
Previous: Junio C HamanoNext: kristofferhaugsbakk@fastmail.com
Message 4 of 5 in “checkout: refer to other-worktree branch, not ref”
  1. checkout: refer to other-worktree branch, not refKristoffer Haugsbakk, Oct 9, 2024
  2. Kristoffer HaugsbakkOct 9, 2024
  3. Junio C HamanoOct 9, 2024
  4. Kristoffer HaugsbakkOct 10, 2024
  5. checkout: refer to other-worktree branch, not refkristofferhaugsbakk@fastmail.com, Oct 10, 2024

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.