-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Labels
traverseRelates to how tree traversal is performedRelates to how tree traversal is performed
Milestone
Description
git traverse -W refuses to continue when a managed branch is already checked out in another location using git worktree:
fatal: 'feature-branch' is already checked out at 'path/to/the/worktree/'
git checkout --quiet feature-branch -- returned 128
When working with stacked PRs or generally multiple PRs (otherwise why would you need git machete in the first place!) it's actually very common to have them checked out in separate worktrees. So this is entirely blocking using traverse when worktrees are involved.
Am I missing something?
I have two ideas how to solve this:
- Quick and potentially unsafe: add the option to traverse with
--ignore-other-worktreesadded to git checkout operations. The problem is when the worktrees are in a dirty state. This wouldn't update the state in the worktree itself and might leave an inconsistent state of the branch. Perhaps, only in case of dirty state traverse would refuse to work. - Instead of checking out, traverse could jump cd into the worktree and perform the necessary updates from there.
Metadata
Metadata
Assignees
Labels
traverseRelates to how tree traversal is performedRelates to how tree traversal is performed