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

Make worktree root movable #20

Open
hakoerber opened this issue Dec 23, 2021 · 0 comments
Open

Make worktree root movable #20

hakoerber opened this issue Dec 23, 2021 · 0 comments
Labels
enhancement New feature or request research required

Comments

@hakoerber
Copy link
Owner

hakoerber commented Dec 23, 2021

Currently, the .git file inside the worktrees references the main worktree via an absolute path. Same for the worktree symlinks in .git-main-working-tree/worktrees/{worktree}/commondir.

This means that whenever you move the whole worktree, the whole thing breaks.

Using git worktree actually leads to the same behaviour, so grm at least does not behave worse than git here.

I'm not sure whether using relative paths is something that git supports and libgit2 exposes. But would be really cool to have if possible. I'd rather not hack this manually, so if it's not exposed by libgit2, the behaviour just has to be accepted.

To do

  • Check whether there is any way to make git use relative paths
  • Check whether the functionality is there in libgit2
  • Implement it in grm if possible. Relative paths should be the default. This would break moving single worktrees, but that is something that would not be supported anyway.
  • Make it explicit in the docs that moving worktrees is not supported. If really necessary, there could be a separate command to do this. But I'm 99% certain that this is not required.
@hakoerber hakoerber added enhancement New feature or request research required labels Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request research required
Projects
None yet
Development

No branches or pull requests

1 participant