arusahni / git-req

Check out merge requests from your GitLab/GitHub hosted repositories from the command line with just the request number.
https://arusahni.github.io/git-req/
MIT License
57 stars 7 forks source link

Improve project ID detection for repositories in GitLab groups #51

Closed arusahni closed 3 years ago

arusahni commented 4 years ago

I don't think project ID detection works for GitLab groups (e.g., gitlab.com/myOrg/myGroup/myProject). This should be addressed.

tjtelan commented 4 years ago

This issue interests me, because I have a crate that does url parsing for git repos.

However, as I don't use GitLab, I'm unfamiliar with their url structure. I don't seem to be able to find any public examples of gitlab urls which have the same namespacing structure in your example. It is similar to Azure DevOps though.

Do you happen to be able to offer one? I'd like to contribute to your project and offer a PR for this issue if you're interested in depending on my crate.

Thanks for your time!

arusahni commented 4 years ago

Sure! GitLab themselves actually do a lot of their development in the open. As such, they have some available examples:

Your crate looks like it provides a more robust solution than what I've currently hacked together :-) . I'm fine with including it as a dependency.

tjtelan commented 4 years ago

Wow, thanks!

These are good examples. I need to do a little more research with respect to subgroups. I need to consider how to offer specialized parsing for Gitlab's unique features that aren't just based on assuming gitlab.com

arusahni commented 3 years ago

@tjtelan I ended up using your library because writing a one-size-fits-all regex was not how I wanted to spend my time :-)

To get git-req to grok the nesting, I do some cleanup on the path - namely, stripping the leading / and optional trailing .git.