-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git-worktree functionality for managing multiple working trees #339
Conversation
@jettseale This PR is currently a draft, but please try out the tests to see if anything breaks on your Windows system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c550e6f
to
d43cc23
Compare
…status before removal
…s throws FSREQCALLBACK errors; per https://github.com/tschaub/mock-fs#async-warning
8d57ffd
to
36d2bc2
Compare
…ort git-worktree workflows
…tory to prevent race conditions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description:
Cards linked to files on git branches that do not match the current repository branch have previously required creating temporary shadow clones of the repository in order to switch branches and copy the necessary files. This process is costly and also leaves no recourse for any subsequent changes to be saved and tracked via version control.
git-worktree
provides the ability to manage multiple working trees:Implementing
git-worktree
withinisomoprhic-git
would be ideal, but until then we can wrap the functionality ofgit-worktree
around the necessary functions exposed byisomorphic-git
. The following functions must be implemented:git-worktree.add
git-worktree.list
git-worktree.lock
git-worktree.move
git-worktree.prune
git-worktree.remove
git-worktree.repair
git-worktree.unlock
This PR resolves #69, and signifies the following version changes:
Changes:
This PR makes the following changes:
git-worktree.add
function creates a new linked worktree directory outside of the main worktree directory and checks out the targetcommit-ish
branch/commit.git-worktree.list
returns a formatted collection ofWorktree
objects containing a path to the linked worktree root directory, a branch name or symbolic ref pointed to by each worktree, a SHA-1 hash for the revision/commit that represents the current state of the worktreeindex
, and indicators for bare repository and detached state statuses.git-worktree.prune
for removing entries from the$GIT_DIR/worktrees
directory for any linked worktrees that have subsequently seen their worktree root directory deleted.git-worktree.remove
for cleanly removing a linked worktree (including entries in$GIT_DIR/worktrees
); requires the use of theforce
parameter for unclean worktrees (untracked files or modifications in tracked files) or ones with submodules.Checklist:
Before submitting this PR, I have verified that my code:
fix/
orfeat/
branch that was initially branched off fromdevelopment
.yarn lint
) and unit testing (yarn test
).yarn package
).Additionally, I have verified that: