You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 1, 2022. It is now read-only.
For me, the usefulness is a bit limited since our (internal) GitLab server is not named gitlab.foo.bar but instead git.foo.bar, so the heuristics for auto-detecting the GitLab remote does not work
I did the following local tweak which works for me but is rather silly (I have an origin remote which is my personal fork and an upstream remote which is the main repository). If we could find a way to conditionalize this (perhaps with a config parameter or ENV variable), it would be great and increase the usefulness of the tool. Do you have any ideas?
diff --git a/internal/gitutil/gitutil.go b/internal/gitutil/gitutil.go
index c298b1e..c58d867 100644
--- a/internal/gitutil/gitutil.go+++ b/internal/gitutil/gitutil.go@@ -193,7 +193,7 @@ func (c *RemoteCollecter) collectTargetByArgs(pInfo *GitLabProjectInfo, project,
func filterHasGitlabDomain(remoteInfos []*git.RemoteInfo) []*git.RemoteInfo {
var gitlabRemotes []*git.RemoteInfo
for _, remoteInfo := range remoteInfos {
- if strings.HasPrefix(remoteInfo.Domain, "gitlab") {+ if strings.HasPrefix(remoteInfo.Domain, "gitlab") || remoteInfo.Remote == "upstream" {
gitlabRemotes = append(gitlabRemotes, remoteInfo)
}
}