hakoerber / git-repo-manager

A git tool to manage worktrees and integrate with GitHub and GitLab
https://hakoerber.github.io/git-repo-manager/
GNU General Public License v3.0
62 stars 9 forks source link

Slashes in branch names #60

Open pgierz opened 1 year ago

pgierz commented 1 year ago

Hi there,

Thanks for this project, it has been quite useful. I have one feature request, and I'd be happy to help out myself, unfortunately I am only a beginner with rust.

In my own work, I like to organise branches under "virtual" folders, e.g. a typical project might look like this:

$ git branch
* master
  feat/my_cool_feat_1
  sprint/subtask_B
  sprint/subtask_C

It would be very cool to integrate this into the worktree command, so that I could have:

$ cd Code/my_project
$ ls
master/ feat/ sprint/
$ ls feat
feat/my_cool_feat_1/
$ cd feat/my_cool_feat_1
$ git branch
  master
* feat/my_cool_feat_1
  sprint/subtask_B
  sprint/subtask_C

At the moment, it seems slashes are not allowed in worktree names. Would that be difficult to implement?

Cheers, Paul

hakoerber commented 11 months ago

Hey Paul,

you hit one of the issues that I've been thinking about since the beginning of the project :smile:

See also #36

The gist is that git (i.e. the command line tool) supports worktrees with slashes no problem, but libgit2 handles slashes differently than git itself. This leads to various problems, as @maurelian alluded to in the linked issue.

I'm unfortunately not aware of the specific things that go wrong with slashes in worktree names. Could you show your use case and precisely how grm fails when you try to use it?