[PATCH 0/7] fix checking out a being-rebased branch
- From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
- Date
- Apr 17, 2016, 12:59 UTC
- Message-ID
- <1460897965-486-1-git-send-email-pclouds@gmail.com>
- In-Reply-To
- <CACsJy8BOwzJSmS3PPeeRuaRwq=+kYLH8NX0i7P_wfDW9gLt6bA@mail.gmail.com>
First cut. I need opinions on 05/07, which converts wt_status_get_state() to support selecting any worktree. I'm not super happy with leaving "TODO: not supported yet" comments, even though strictly speaking this series does not need it.
The reason it's left unsupported is, in order to add worktree_get_sha1() or similar, resolve_ref() will be touched. But that function is going under some changes for quite some time now, for lmdb backend support, and I don't want to create more code conflicts there, potentially delaying lmdb backend further.
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() [05/07] wt-status.c: make wt_status_get_state() support worktree [06/07] worktree.c: avoid referencing to worktrees[i] multiple times [07/07] checkout: prevent checking out a branch being rebased in another worktree
Total 6 files changed, 167 insertions(+), 38 deletions(-)