Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: An option to ignore private repos #91

Closed
mvdan opened this issue Feb 22, 2018 · 4 comments
Closed

Request: An option to ignore private repos #91

mvdan opened this issue Feb 22, 2018 · 4 comments

Comments

@mvdan
Copy link

mvdan commented Feb 22, 2018

If I have a private repo in my GOPATH, chances are it's a work repository or a private/personal thing. In both cases, I'm very likely to be a contributor, so Go-Package-Store is of little use.

I understand that I can set up a GitHub token, but that's a different approach. I simply don't want the tool to check for updates on a repo if it notices it has no access to said repo.

I know this can be tricky, because a private repo is generally just a 404, just like a missing repo. So it would be fine if the flag was called -ignore-missing instead of -ignore-private.

@dmitshur
Copy link
Member

The current solution is to do something like:

go list all | grep -v private/repo/to/exclude | Go-Package-Store -stdin

Or an alias version thereof to save on typing. This issue is very similar to #89.

I'm not sure if there's a reliable general way GPS can detect "private" repos, but I'll think about it a bit before closing.

@mvdan
Copy link
Author

mvdan commented Feb 23, 2018

Thanks for the reply!

go list | grep does sound like a solution, I didn't know I could feed that into GPS. However, go list all on my system takes about five seconds, so I don't know if that's optimal. But if GPS would otherwise do the same work anyway, I guess it's the same.

@dmitshur
Copy link
Member

dmitshur commented Feb 23, 2018

It has to do roughly the same work, see here, but with two differences:

  1. Thanks to the parallelized and pipelined processing, it starts looking for updates as soon as some repos are discovered. It doesn't need to wait entire 5 seconds before it can get started.
  2. It stops after finding repository roots, without finding all individual Go packages inside, so it's a bit faster than go list all. Not by much though.

5 seconds for go list all is a bit lengthy but not too unreasonable if your GOPATH is quite large. You should ensure that you don't have any large extraneous files/folders in it that would slow down processing (it's okay if they begin with ., _ or are in testdata). See bradfitz/go-issue-mirror#13 for more information on what that can be like.

@mvdan
Copy link
Author

mvdan commented Feb 23, 2018

Ha, that's a good point. I never wondered why it was so slow. I tend to go get -d a lot of things, so yes, I have lots of crap.

@mvdan mvdan closed this as completed Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants