Re: [PATCH v2] worktree: add: introduce --checkout option
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Mar 25, 2016, 12:15 UTC
- Message-ID
- <CACsJy8BhFjS=t1cjJ2D5UzNk6avd8LknL1xg5admeu--YWjyew@mail.gmail.com>
- In-Reply-To
- <CABEEbiAeMZ=PSScFJ98DkqyDBGTC1OBvTb8bLAn=whLjXJvdzA@mail.gmail.com>
Please don't top-post.
On Fri, Mar 25, 2016 at 7:06 PM, Zhang Lei <zhanglei002@gmail.com> wrote:
Show 6 quoted lines
> Yes, path basename makes sense. > I am asking this question because we have some legacy code requires > that working tree > called something like 'src', as a result, multiple branch would have > src1 src2 src3 under .git/worktrees > which could not be easy to maintain.
If you really need to care about these names, I think a new option to let you control the naming explicitly would be better.
Show 19 quoted lines
> I agreed with you, we should give users such option. > > > 2016-03-25 19:41 GMT+08:00 Duy Nguyen <pclouds@gmail.com>: >> On Fri, Mar 25, 2016 at 6:31 PM, Zhang Lei <zhanglei002@gmail.com> wrote: >>> By the way, Duy, another unrelated question: why worktree name under >>> .git/worktrees is being named >>> after the working tree path basename? I think branch name is more >>> reasonable since we don't allow checking out >>> the same branch twice. >> >> Because branch name is not always available (e.g. detached HEAD) and >> checkout branch can be switched later on. And normally you'll get >> branch name there anyway with "git worktree add something" because the >> branch "something" is automatically created. I've been wondering if >> it's worth supporting "git worktree -b abc ./" where we create >> worktree "./abc" based on branch name too. >> -- >> Duy
-- Duy