Skip to content
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 implementation #380

Closed
6 of 10 tasks
nelsonni opened this issue Mar 17, 2021 · 0 comments · Fixed by #339 or #946
Closed
6 of 10 tasks

git-worktree implementation #380

nelsonni opened this issue Mar 17, 2021 · 0 comments · Fixed by #339 or #946
Assignees
Labels
feature Feature requests or improvements

Comments

@nelsonni
Copy link
Member

nelsonni commented Mar 17, 2021

Is your feature request related to a problem? Please describe.
git-worktree provides the ability to manage multiple working trees:

A git repository can support multiple working trees, allowing you to check out more than one branch at a time. With git worktree add a new working tree is associated with the repository. This new working tree is called a "linked working tree" as opposed to the "main working tree" prepared by git-init[1] or git-clone[1]. A repository has one main working tree (if it’s not a bare repository) and zero or more linked working trees. When you are done with a linked working tree, remove it with git worktree remove.

In its simplest form, git worktree add automatically creates a new branch whose name is the final component of , which is convenient if you plan to work on a new topic. For instance, git worktree add ../hotfix creates new branch hotfix and checks it out at path ../hotfix. To instead work on an existing branch in a new working tree, use git worktree add . On the other hand, if you just plan to make some experimental changes or do testing without disturbing existing development, it is often convenient to create a throwaway working tree not associated with any branch. For instance, git worktree add -d creates a new working tree with a detached HEAD at the same commit as the current branch.

Describe the solution you'd like
Implementing git-worktree within isomoprhic-git would be ideal, but until then we can wrap the functionality of git-worktree around the necessary functions exposed by isomorphic-git. The following functions must be implemented:

Not included in the git-worktree API, but necessary for all other interactions:

  • git-worktree.status (added in 61fea88)
  • git-worktree.statusMatrix (added in fd51347)

Describe alternatives you've considered
N/A

Additional context
All src/containers/git.ts functions that interact with files will probably need to be updated to support the different path structures in git-worktree directories.

@nelsonni nelsonni added the feature Feature requests or improvements label Mar 17, 2021
@nelsonni nelsonni self-assigned this Mar 17, 2021
@nelsonni nelsonni linked a pull request Mar 17, 2021 that will close this issue
16 tasks
@nelsonni nelsonni mentioned this issue Oct 6, 2022
@nelsonni nelsonni linked a pull request Oct 6, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature requests or improvements
Projects
None yet
1 participant