Skip to content
This repository has been archived by the owner on Feb 3, 2018. It is now read-only.

Prioritize default branches above others #65

Closed
sdboyer opened this issue Jul 14, 2016 · 1 comment
Closed

Prioritize default branches above others #65

sdboyer opened this issue Jul 14, 2016 · 1 comment
Milestone

Comments

@sdboyer
Copy link
Owner

sdboyer commented Jul 14, 2016

go get relies, at times sort of implicitly, on having the upstream repository determine which branch should be grabbed on initial clone...at least in cases like git, where branches are multiplexed and not expressed directly in the path. (Also the case for hg, not the case for bzr or svn).

In order to remain maximally similar to go get, we need to have these branches always sort higher than other branches in version queues (where they are otherwise alpha-sorted). This guarantees that the solver will try them first, which amounts to the being the same as go get when no semver tags are available.

Implementing this symbolically shouldn't be very difficult - an extra field on branchVersion to indicate whether it's a default branch or not. What's slightly trickier - or at least possibly more costly wrt network requests - is figuring out what that default branch is in ListVersions().

@sdboyer
Copy link
Owner Author

sdboyer commented Jul 14, 2016

...crap, also need to change the sort order for version types to put branches above plain versions. ...i think that's the right call? probably.

EDIT: fixed this in #98

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant