[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: Minor missing features in worktree compare to new-workdir
From:       Yichao Yu <yyc1992 () gmail ! com>
Date:       2017-06-15 0:40:21
Message-ID: CAMvDr+TsdO5V694R5gpaWwyjkSHXW=QYG8n74ULVYZ5pbuY-zA () mail ! gmail ! com
[Download RAW message or body]

>> 2. worktree doesn't seem to support multiple worktree on the same
>> branch.
>
> I think this is a very good thing about worktrees as opposed to
> workdirs.
>
> In a situation where I may want multiple worktrees pointing to the same
> commit I just check out the SHA rather than the branch: you can have as

Hmm, this could be workable. Though in that case it'll be nice to have
a easier way to checkout the SHA corresponding to a branch.

> many branches set to the same SHA (detached HEAD) as you like, and
> there's no concern about dirty workspaces.  This latter can actually be
> a really big problem (suppose the workdir contained some modified files
> then you update another workdir with the same branch... it's not easy to
> figure out what happened here!)

Unless it can cause internal corruption I'd still prefer to allow this
with warning/option. I have indeed cause dirty state myself though 95%
of the time it's because I forgot to remove the checkout that I'm done
using and the rest 5% being temperary state that I intentionally cause
(e.g. update in one checkout before hard resetting the second one).
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic