PoC: Open webpage of remote repository
Last year #2468 (closed) was opened and later closed as "won't fix". But I am very much interested in such a feature. So I created a proof of concept for this.
Before I commit these changes and open a MR I wanted to know if you are interested in this. Was the "won't fix" because you don't want the feature at all or because you didn't want to write the code to do it back then?
What I did so far:
I created a class OpenCommand
in TortoiseProc and did all the plumbing so TortoiseGitProc /command:open
works. In that class I retrieve the url of the remote origin, use CString::Replace() and std::regex to convert the "git remote" url to the proper "web" url and opens the url with ShellExecute().
I implemented the very basics for gitlab.com and github.com, each for https and ssh.
I also added the code to add the menu entry to TortoiseShell. It compiles but have not yet been able to test it. Any hints on how to test this are much appreciated.
At the office we run GitLab CE in our LAN on a domain name something like "git.example.local". I am very interested in opening those pages as well. It requires a setting (global or per repo) to define the domain name of the GitLab instance. For me creating a setting with git config
would do for now.
Opening web pages for other repository hosters (bitbucket, SourceForge, Savannah, repo.or.cz to name a few) is fairly easy to add.
In the future it would be nice to be able to open the page of the current branch or selected file, support multiple remotes (origin, upstream), opening issues and PR/MR pages, etc. Some/most of this probably requires a dialog.
So the question, are you interested in a MR with my current implementation?