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

Allow multiple forges #39

Open hakoerber opened 2 years ago

hakoerber commented 2 years ago

Different remotes could be used at the same time, with the repositories being combined.

What information to use to determine whether two projects are the same on both forges?

Could be:

There could also be a mapping that allows namespaces to be mapped between forges. Something like --map=github:github_user=gitlab=gitlab_user. Or in config:

[[mapping]]
github = "github_user"
gitlab = "gitlab_user"

But: What should be given to --group or --user then? Better to have a mapping from a forge-independent handle to a name for each forge. E.g:

--map=myuser@github:github_user@gitlab:gitlab_user --user=myuser

Or in config:

[mapping.myuser]
github = "github_user"
gitlab = "gitlab_user"

Whenever GRM then encounters a (namespace, name) tuple from a forge, it checks whether namespace or any parent matches the mapping, and replaces it accordingly.

E.g.:

Imagine the mapping from above:

Namespace in Namespace out
/myuser/ /github_user/
/myuser/mysubgroup/ /github_user/mysubgroup/
/group/myuser/ No change, as the mapping is not a prefix
/myuserfoo/ No change, as the mapping only specifies part of the path component

This mapping would also transfer to the rest of GRM like local path names for clones.

This would also be cool to put into a global config in $XDG_CONFIG_HOME