Re: Able to checkout same branch in multiple worktrees when using symbolic-refs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Austin Morton <austin.morton@xxxxxxxxxxx> writes:

[jc: swapped the blocks to chronological order, and trimmed parts
that are not relevant to this reply].

> On Fri, Apr 29, 2022 at 8:19 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>>
>> Austin Morton <austin.morton@xxxxxxxxxxx> writes:
>>
>> I also suspect there is no way, other than scanning _all_ the local
>> branches, to see if some other branch aliases the branch we are
>> about to check out.  It may potentially be somewhat expensive.
>
> I don't know why you would need to scan all the local branches, unless
> that is what "git worktree list" ends up doing under the hood?
> ...
> Seems like you would "just" need to resolve the symbolic-ref in the
> same way that the worktree code does when checking against existing
> worktrees in find_shared_symref during checkout.

Yeah, you're right.

You would scan all the worktrees instead of asking all the
local branches "Are you a symlink that points at a branch I am about
to check out?  If so, yell loudly to stop me."

>> But it would be nice if it can get fixed in inexpensively.
>>
>> Thanks for a report.

So, yeah, it may be doable to fix it inexpensively.

Patches welcome ;-)

Thanks.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux