golang / gddo

Go Doc Dot Org
https://godoc.org
BSD 3-Clause "New" or "Revised" License
1.1k stars 265 forks source link

Unusual Go package setup (regarding import path and expected origin remote). #470

Open dmitshur opened 7 years ago

dmitshur commented 7 years ago

I want to report the following relatively minor but avoidable issue, for visibility.

The Go packages in this repository have an unusual setup. This mostly affects developers/contributors, not users.

The canonical import path is:

github.com/golang/gddo

However, the git repository at that location is just a mirror, the actual canonical source of the repository is:

go.googlesource.com/gddo

That means you can't just go get the package and be able to contribute via Gerrit. You need to either follow that up with git remote rm origin && git remote add origin https://go.googlesource.com/gddo, or manually git clone https://go.googlesource.com/gddo into $GOPATH/src/github.com/golang/gddo. This is documented in https://github.com/golang/gddo#contributions.

This is relatively minor, but it's non-standard, which has some additional mental overhead and increases the barrier to contributions slightly (/cc @rakyll FYI). I personally find it slightly unpleasant because gostatus constantly complains about this non-standard setup:

$ gostatus github.com/golang/gddo/...
  #  github.com/golang/gddo/...
    # Remote URL doesn't match repo URL inferred from import path:
          (actual) https://go.googlesource.com/gddo
        (expected) https://github.com/golang/gddo

Out of 2138 Go packages I have in my GOPATH, this is the only one.

There are multiple different ways to resolve this issue. Resolving this issue might be relatively costly, and as a result it may not be worth doing.

dolmen commented 7 years ago

When doing my first contribution this problem has been painful. I had fetch gddo with go get -u github.com/golang/gddo as I do for all other Go projects from GitHub. When I tried git codereview mail, it did not work and as that was my first Gerrit experience I didn't knew why. And the contribution guidelines, being the generic ones from the Go project, did not help.