module.exports = [{
  // Bitbucket
  exps: [
    /^()git@(bitbucket\.org):([^\/]+)\/([^\/\.]+)\.git$/,
    /^(https?):\/\/(bitbucket\.org)\/([^\/]+)\/([^\/\.]+)(\.git)?$/,
    /^(https?):\/\/.+@(bitbucket\.org)\/([^\/]+)\/([^\/\.]+)(\.git)?$/
  ],
  template: "{protocol}://{host}/{user}/{repo}/commits/{hash}"
},{
  // Generic (Github, GitLab and others)
  exps: [
    /^()git@(.*):(.+)\/(.+)\.git$/,
    /^(https?):\/\/([^@\/]+)\/([^\/]+)\/([^\/\.]+)(\.git)?$/,
    /^(https?):\/\/.+@([^\/]+)\/([^\/]+)\/([^\/\.]+)(\.git)?$/
  ],
  template: "{protocol}://{host}/{user}/{repo}/commit/{hash}"
}]

module.exports = [{
  // Bitbucket
  exps: [
    /^()git@(bitbucket\.org):([^\/]+)\/([^\/\.]+)\.git$/,
    /^(https?):\/\/(bitbucket\.org)\/([^\/]+)\/([^\/\.]+)(\.git)?$/,
    /^(https?):\/\/.+@(bitbucket\.org)\/([^\/]+)\/([^\/\.]+)(\.git)?$/
  ],
  template: "{protocol}://{host}/{user}/{repo}/commits/{long-hash}"
},{
  // Generic (Github, GitLab and others)
  exps: [
    /^()git@(.*):(.+)\/(.+)\.git$/,
    /^(https?):\/\/([^@\/]+)\/([^\/]+)\/([^\/\.]+)(\.git)?$/,
    /^(https?):\/\/.+@([^\/]+)\/([^\/]+)\/([^\/\.]+)(\.git)?$/
  ],
  template: "{protocol}://{host}/{user}/{repo}/commit/{long-hash}"
}]

Use long hashes in Github and Bitbucket URLs
Use long hashes in Github and Bitbucket URLs

This way when you open the link in browser and then save it somewhere
for the future, it won't become outdated when the amount of commits in
repository increases to the level where the short hash that previously
was unique isn't fully unique any more.
