shurcooL / Go-Package-Store

An app that displays updates for the Go packages in your GOPATH.
MIT License
900 stars 29 forks source link

workspace: Report better reasons for not showing updates. #76

Closed dmitshur closed 7 years ago

dmitshur commented 7 years ago

Rearrange order of checks in shouldPresentUpdate, so that highest level reasons are checked and returned first.

This eliminates poor skip reasons that cause user to play whack-a-mole. There's no point in trying to fix the locally checked out branch first, if the remote repository is completely wrong.

Fixes #74 (again). Updates #73.

Before

$ Go-Package-Store 
Using all Go packages in GOPATH.
Go Package Store server is running at http://localhost:7043/updates.
skipping "gopkg.in/src-d/go-git.v4" because:
    local branch "v4" doesn't match remote branch "master"

After

$ Go-Package-Store 
Using all Go packages in GOPATH.
Go Package Store server is running at http://localhost:7043/index.html.
skipping "gopkg.in/src-d/go-git.v4" because:
    remote URL doesn't match repo URL inferred from import path:
          (actual) https://github.com/mvdan/go-git
        (expected) https://gopkg.in/src-d/go-git.v4

/cc @mvdan FYI.