Re: [PATCH 0/7] fix checking out a being-rebased branch
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Apr 19, 2016, 01:04 UTC
- Message-ID
- <CACsJy8BCg3GO1g0Z+S+bDYT3Bdh8d8q0WHz=JoeALvYwfNrM0A@mail.gmail.com>
- In-Reply-To
- <xmqqpotm6cfq.fsf@gitster.mtv.corp.google.com>
On Tue, Apr 19, 2016 at 12:42 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
>> Another option is leave wt_status_get_state() alone, factor out the >> rebase-detection code and use that for worktree/checkout. We save a >> few syscalls this way too. >> >> Comments? >> >> [01/07] path.c: add git_common_path() and strbuf_git_common_path() >> [02/07] worktree.c: store "id" instead of "git_dir" >> [03/07] path.c: refactor and add worktree_git_path() >> [04/07] worktree.c: add worktree_git_path_..._head() > > I actually wondered how ky/branch-[dm]-worktree topics to avoid > "branch -d" and "branch -m" from removing or renaming a branch that > is checked out in other worktrees from screwing them up. There may > be a missed opportunity to clean them up with using these?
branch-m-worktree uses info populated at get_worktrees() phase. branch-d-worktree uses find_shared_symref() which is modified in this series in order to detect rebase branch. So both topics have the same problem when a branch is being rebased and if I do it right, I'll fix them both without extra code. Actually I may need to check branch-m-worktree again, renaming a branch under rebase might cause problems, I need to have a closer look at git-rebase*.sh.
-- Duy