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}'
15 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ],
16 'domain': 'bitbucket.org',
20 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ],
21 'domain': 'gitlab.com',
23 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#README',
24 'bugstemplate': 'https://{domain}/{user}/{project}/issues'
27 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ],
28 'domain': 'gist.github.com',
29 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]+)(?:[.]git)?$/,
30 'filetemplate': 'https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}',
31 'bugstemplate': 'https://{domain}/{project}',
32 'gittemplate': 'git://{domain}/{project}.git{#committish}',
33 'sshtemplate': 'git@{domain}:/{project}.git{#committish}',
34 'sshurltemplate': 'git+ssh://git@{domain}/{project}.git{#committish}',
35 'browsetemplate': 'https://{domain}/{project}{/committish}',
36 'docstemplate': 'https://{domain}/{project}{/committish}',
37 'httpstemplate': 'git+https://{domain}/{project}.git{#committish}',
38 'shortcuttemplate': '{type}:{project}{#committish}',
39 'pathtemplate': '{project}{#committish}'
43 var gitHostDefaults = {
44 'sshtemplate': 'git@{domain}:{user}/{project}.git{#committish}',
45 'sshurltemplate': 'git+ssh://git@{domain}/{user}/{project}.git{#committish}',
46 'browsetemplate': 'https://{domain}/{user}/{project}{/tree/committish}',
47 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#readme',
48 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{project}.git{#committish}',
49 'filetemplate': 'https://{domain}/{user}/{project}/raw/{committish}/{path}',
50 'shortcuttemplate': '{type}:{user}/{project}{#committish}',
51 'pathtemplate': '{user}/{project}{#committish}',
52 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/
55 Object.keys(gitHosts).forEach(function (name) {
56 Object.keys(gitHostDefaults).forEach(function (key) {
57 if (gitHosts[name][key]) return
58 gitHosts[name][key] = gitHostDefaults[key]
60 gitHosts[name].protocols_re = RegExp('^(' +
61 gitHosts[name].protocols.map(function (protocol) {
62 return protocol.replace(/([\\+*{}()\[\]$^|])/g, '\\$1')