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

Allow Git paths to specify a default branch #17

Open
zombiezen opened this issue Jan 29, 2018 · 1 comment
Open

Allow Git paths to specify a default branch #17

zombiezen opened this issue Jan 29, 2018 · 1 comment
Assignees

Comments

@zombiezen
Copy link
Contributor

I'd like to add support for having paths correspond with a particular branch of a repository. This would enable, for instance, a custom import path to allow gopkg.in-style versioning. A hypothetical example:

host: example.com
paths:
  /foo:
    repo: https://github.com/example/foo
  /foo.v2:
    repo: https://github.com/example/foo
    branch: v2

and then gradually the branches could be swapped:

host: example.com
paths:
  /foo:
    repo: https://github.com/example/foo
    branch: v1
  /foo.v2:
    repo: https://github.com/example/foo

I propose taking the approach used by gopkg.in: point the source URL to a dummy URL on the govanityurls server, rewrite the refs response, then HTTP 301 over to the real Git repository.

I think a similar approach could be added for Mercurial later, but I'd rather focus on Git right now.

@rakyll WDYT?

@zombiezen zombiezen self-assigned this Jan 29, 2018
@rakyll
Copy link
Contributor

rakyll commented Jan 30, 2018

LGTM, I don't see any critical problems.

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

No branches or pull requests

2 participants