From b6c6afebf8483a7b8706930913a91b318d3d49a6 Mon Sep 17 00:00:00 2001 From: Songmu Date: Wed, 1 May 2019 14:32:22 +0900 Subject: [PATCH 1/2] good bye google code --- remote_repository.go | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/remote_repository.go b/remote_repository.go index db7fe92b..7c787989 100644 --- a/remote_repository.go +++ b/remote_repository.go @@ -64,30 +64,6 @@ func (repo *GitHubGistRepository) VCS() (*VCSBackend, *url.URL) { return GitBackend, repo.URL() } -type GoogleCodeRepository struct { - url *url.URL -} - -func (repo *GoogleCodeRepository) URL() *url.URL { - return repo.url -} - -var validGoogleCodePathPattern = regexp.MustCompile(`^/p/[^/]+/?$`) - -func (repo *GoogleCodeRepository) IsValid() bool { - return validGoogleCodePathPattern.MatchString(repo.url.Path) -} - -func (repo *GoogleCodeRepository) VCS() (*VCSBackend, *url.URL) { - if cmdutil.RunSilently("hg", "identify", repo.url.String()) == nil { - return MercurialBackend, repo.URL() - } else if cmdutil.RunSilently("git", "ls-remote", repo.url.String()) == nil { - return GitBackend, repo.URL() - } else { - return nil, nil - } -} - type DarksHubRepository struct { url *url.URL } @@ -182,10 +158,6 @@ func NewRemoteRepository(url *url.URL) (RemoteRepository, error) { return &GitHubGistRepository{url}, nil } - if url.Host == "code.google.com" { - return &GoogleCodeRepository{url}, nil - } - if url.Host == "hub.darcs.net" { return &DarksHubRepository{url}, nil } From c8061934e3df0702c5515c1a9c6515fc4052a1fe Mon Sep 17 00:00:00 2001 From: Songmu Date: Wed, 1 May 2019 14:35:12 +0900 Subject: [PATCH 2/2] good bye jazzHub --- remote_repository.go | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/remote_repository.go b/remote_repository.go index 7c787989..ab95b424 100644 --- a/remote_repository.go +++ b/remote_repository.go @@ -3,7 +3,6 @@ package main import ( "fmt" "net/url" - "regexp" "strings" "github.com/motemen/ghq/cmdutil" @@ -80,24 +79,6 @@ func (repo *DarksHubRepository) VCS() (*VCSBackend, *url.URL) { return DarcsBackend, repo.URL() } -type BluemixRepository struct { - url *url.URL -} - -func (repo *BluemixRepository) URL() *url.URL { - return repo.url -} - -var validBluemixPathPattern = regexp.MustCompile(`^/git/[^/]+/[^/]+$`) - -func (repo *BluemixRepository) IsValid() bool { - return validBluemixPathPattern.MatchString(repo.url.Path) -} - -func (repo *BluemixRepository) VCS() (*VCSBackend, *url.URL) { - return GitBackend, repo.URL() -} - type OtherRepository struct { url *url.URL } @@ -162,10 +143,6 @@ func NewRemoteRepository(url *url.URL) (RemoteRepository, error) { return &DarksHubRepository{url}, nil } - if url.Host == "hub.jazz.net" { - return &BluemixRepository{url}, nil - } - gheHosts, err := GitConfigAll("ghq.ghe.host") if err != nil {