3 var gitHosts = module.exports = {
5 // First two are insecure and generally shouldn't be used any more, but
6 // they are still supported.
7 'protocols': [ 'git', 'http', 'git+ssh', 'git+https', 'ssh', 'https' ],
8 'domain': 'github.com',
10 'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}',
11 'bugstemplate': 'https://{domain}/{user}/{project}/issues',
12 'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}',
13 'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz'
16 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ],
17 'domain': 'bitbucket.org',
19 'tarballtemplate': 'https://{domain}/{user}/{project}/get/{committish}.tar.gz'
22 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ],
23 'domain': 'gitlab.com',
25 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#README',
26 'bugstemplate': 'https://{domain}/{user}/{project}/issues',
27 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}'
30 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ],
31 'domain': 'gist.github.com',
32 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]+)(?:[.]git)?$/,
33 'filetemplate': 'https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}',
34 'bugstemplate': 'https://{domain}/{project}',
35 'gittemplate': 'git://{domain}/{project}.git{#committish}',
36 'sshtemplate': 'git@{domain}:/{project}.git{#committish}',
37 'sshurltemplate': 'git+ssh://git@{domain}/{project}.git{#committish}',
38 'browsetemplate': 'https://{domain}/{project}{/committish}',
39 'docstemplate': 'https://{domain}/{project}{/committish}',
40 'httpstemplate': 'git+https://{domain}/{project}.git{#committish}',
41 'shortcuttemplate': '{type}:{project}{#committish}',
42 'pathtemplate': '{project}{#committish}',
43 'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz'
47 var gitHostDefaults = {
48 'sshtemplate': 'git@{domain}:{user}/{project}.git{#committish}',
49 'sshurltemplate': 'git+ssh://git@{domain}/{user}/{project}.git{#committish}',
50 'browsetemplate': 'https://{domain}/{user}/{project}{/tree/committish}',
51 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#readme',
52 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{project}.git{#committish}',
53 'filetemplate': 'https://{domain}/{user}/{project}/raw/{committish}/{path}',
54 'shortcuttemplate': '{type}:{user}/{project}{#committish}',
55 'pathtemplate': '{user}/{project}{#committish}',
56 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/
59 Object.keys(gitHosts).forEach(function (name) {
60 Object.keys(gitHostDefaults).forEach(function (key) {
61 if (gitHosts[name][key]) return
62 gitHosts[name][key] = gitHostDefaults[key]
64 gitHosts[name].protocols_re = RegExp('^(' +
65 gitHosts[name].protocols.map(function (protocol) {
66 return protocol.replace(/([\\+*{}()\[\]$^|])/g, '\\$1')