{"action":"created","comment":{"url":"https://api.github.com/repos/GitTools/GitLink/pulls/comments/47485256","id":47485256,"diff_hunk":"@@ -0,0 +1,48 @@\n+﻿namespace GitLink.Providers\n+{\n+    using GitTools.Git;\n+    using System.Text.RegularExpressions;\n+\n+    public sealed class CustomUrlProvider : ProviderBase\n+    {\n+        private const string FileNamePlaceHolder = \"{filename}\";\n+        private const string RevisionPlaceHolder = \"{revision}\";\n+        private readonly Regex _regexUrl = new Regex(@\"https?://.+\");\n+\n+        private string _rawUrl;\n+\n+        public CustomUrlProvider()\n+            : base(new GitPreparer())\n+        {\n+        }\n+\n+        public override string RawGitUrl\n+        {\n+            get\n+            {\n+                return _rawUrl;\n+            }\n+        }\n+\n+        public override bool Initialize(string url)\n+        {\n+            if (string.IsNullOrEmpty(url) || !_regexUrl.IsMatch(url) ||(\n+                !url.Contains(FileNamePlaceHolder) && !url.Contains(RevisionPlaceHolder)))","path":"src/GitLink/Providers/CustomUrlProvider.cs","position":30,"original_position":30,"commit_id":"a741c1f0ed43afac8ddfb9deeaddee4400c24364","original_commit_id":"a741c1f0ed43afac8ddfb9deeaddee4400c24364","user":{"login":"GeertvanHorrik","id":1246444,"avatar_url":"https://avatars.githubusercontent.com/u/1246444?v=3","gravatar_id":"","url":"https://api.github.com/users/GeertvanHorrik","html_url":"https://github.com/GeertvanHorrik","followers_url":"https://api.github.com/users/GeertvanHorrik/followers","following_url":"https://api.github.com/users/GeertvanHorrik/following{/other_user}","gists_url":"https://api.github.com/users/GeertvanHorrik/gists{/gist_id}","starred_url":"https://api.github.com/users/GeertvanHorrik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeertvanHorrik/subscriptions","organizations_url":"https://api.github.com/users/GeertvanHorrik/orgs","repos_url":"https://api.github.com/users/GeertvanHorrik/repos","events_url":"https://api.github.com/users/GeertvanHorrik/events{/privacy}","received_events_url":"https://api.github.com/users/GeertvanHorrik/received_events","type":"User","site_admin":false},"body":"Fix the ( on the new line please)","created_at":"2015-12-14T11:08:52Z","updated_at":"2015-12-14T11:08:52Z","html_url":"https://github.com/GitTools/GitLink/pull/73#discussion_r47485256","pull_request_url":"https://api.github.com/repos/GitTools/GitLink/pulls/73","_links":{"self":{"href":"https://api.github.com/repos/GitTools/GitLink/pulls/comments/47485256"},"html":{"href":"https://github.com/GitTools/GitLink/pull/73#discussion_r47485256"},"pull_request":{"href":"https://api.github.com/repos/GitTools/GitLink/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/GitTools/GitLink/pulls/73","id":52141884,"html_url":"https://github.com/GitTools/GitLink/pull/73","diff_url":"https://github.com/GitTools/GitLink/pull/73.diff","patch_url":"https://github.com/GitTools/GitLink/pull/73.patch","issue_url":"https://api.github.com/repos/GitTools/GitLink/issues/73","number":73,"state":"open","locked":false,"title":"Support of placeholder ({filename} and {revision}) in the URL plus an option to use an indexing strategy that wouldn't rely on SRCSRV http support, but use a powershell command for URL download instead.","user":{"login":"sMusy","id":15996508,"avatar_url":"https://avatars.githubusercontent.com/u/15996508?v=3","gravatar_id":"","url":"https://api.github.com/users/sMusy","html_url":"https://github.com/sMusy","followers_url":"https://api.github.com/users/sMusy/followers","following_url":"https://api.github.com/users/sMusy/following{/other_user}","gists_url":"https://api.github.com/users/sMusy/gists{/gist_id}","starred_url":"https://api.github.com/users/sMusy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sMusy/subscriptions","organizations_url":"https://api.github.com/users/sMusy/orgs","repos_url":"https://api.github.com/users/sMusy/repos","events_url":"https://api.github.com/users/sMusy/events{/privacy}","received_events_url":"https://api.github.com/users/sMusy/received_events","type":"User","site_admin":false},"body":"I tried to implement the functionality mentioned in the issue #66\r\n\r\nI did pretty much the same thing as Marcind with his CustomRawUrlProvider, here is the readme part.\r\n\r\nRunning for an uncommon URL\r\n\r\nWhen working with a repository using uncommon URL you can use placeholders to specifiy where the filename and revision hash should be, use -u parameter with the custom URL\r\n\r\n       GitLink.exe c:\\source\\catel -u \"https://host/projects/catel/repos/catel/browse/{filename}?at={revision}&raw\"\r\n\r\nThe custom url will be used to fill the placeholders with the relative file path and the revision hash.\r\n\r\nI also added an option to download the sources with powershell because SRCSRV http support doesn't accept characters like \"?\" thus another option was needed","created_at":"2015-11-30T15:59:24Z","updated_at":"2015-12-14T11:08:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"26952b3f8148ed14187fec5c668b49038aec601a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GitTools/GitLink/pulls/73/commits","review_comments_url":"https://api.github.com/repos/GitTools/GitLink/pulls/73/comments","review_comment_url":"https://api.github.com/repos/GitTools/GitLink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GitTools/GitLink/issues/73/comments","statuses_url":"https://api.github.com/repos/GitTools/GitLink/statuses/a741c1f0ed43afac8ddfb9deeaddee4400c24364","head":{"label":"sMusy:develop","ref":"develop","sha":"a741c1f0ed43afac8ddfb9deeaddee4400c24364","user":{"login":"sMusy","id":15996508,"avatar_url":"https://avatars.githubusercontent.com/u/15996508?v=3","gravatar_id":"","url":"https://api.github.com/users/sMusy","html_url":"https://github.com/sMusy","followers_url":"https://api.github.com/users/sMusy/followers","following_url":"https://api.github.com/users/sMusy/following{/other_user}","gists_url":"https://api.github.com/users/sMusy/gists{/gist_id}","starred_url":"https://api.github.com/users/sMusy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sMusy/subscriptions","organizations_url":"https://api.github.com/users/sMusy/orgs","repos_url":"https://api.github.com/users/sMusy/repos","events_url":"https://api.github.com/users/sMusy/events{/privacy}","received_events_url":"https://api.github.com/users/sMusy/received_events","type":"User","site_admin":false},"repo":{"id":47126821,"name":"GitLink","full_name":"sMusy/GitLink","owner":{"login":"sMusy","id":15996508,"avatar_url":"https://avatars.githubusercontent.com/u/15996508?v=3","gravatar_id":"","url":"https://api.github.com/users/sMusy","html_url":"https://github.com/sMusy","followers_url":"https://api.github.com/users/sMusy/followers","following_url":"https://api.github.com/users/sMusy/following{/other_user}","gists_url":"https://api.github.com/users/sMusy/gists{/gist_id}","starred_url":"https://api.github.com/users/sMusy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sMusy/subscriptions","organizations_url":"https://api.github.com/users/sMusy/orgs","repos_url":"https://api.github.com/users/sMusy/repos","events_url":"https://api.github.com/users/sMusy/events{/privacy}","received_events_url":"https://api.github.com/users/sMusy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sMusy/GitLink","description":"Making .NET open source accessible!","fork":true,"url":"https://api.github.com/repos/sMusy/GitLink","forks_url":"https://api.github.com/repos/sMusy/GitLink/forks","keys_url":"https://api.github.com/repos/sMusy/GitLink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sMusy/GitLink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sMusy/GitLink/teams","hooks_url":"https://api.github.com/repos/sMusy/GitLink/hooks","issue_events_url":"https://api.github.com/repos/sMusy/GitLink/issues/events{/number}","events_url":"https://api.github.com/repos/sMusy/GitLink/events","assignees_url":"https://api.github.com/repos/sMusy/GitLink/assignees{/user}","branches_url":"https://api.github.com/repos/sMusy/GitLink/branches{/branch}","tags_url":"https://api.github.com/repos/sMusy/GitLink/tags","blobs_url":"https://api.github.com/repos/sMusy/GitLink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sMusy/GitLink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sMusy/GitLink/git/refs{/sha}","trees_url":"https://api.github.com/repos/sMusy/GitLink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sMusy/GitLink/statuses/{sha}","languages_url":"https://api.github.com/repos/sMusy/GitLink/languages","stargazers_url":"https://api.github.com/repos/sMusy/GitLink/stargazers","contributors_url":"https://api.github.com/repos/sMusy/GitLink/contributors","subscribers_url":"https://api.github.com/repos/sMusy/GitLink/subscribers","subscription_url":"https://api.github.com/repos/sMusy/GitLink/subscription","commits_url":"https://api.github.com/repos/sMusy/GitLink/commits{/sha}","git_commits_url":"https://api.github.com/repos/sMusy/GitLink/git/commits{/sha}","comments_url":"https://api.github.com/repos/sMusy/GitLink/comments{/number}","issue_comment_url":"https://api.github.com/repos/sMusy/GitLink/issues/comments{/number}","contents_url":"https://api.github.com/repos/sMusy/GitLink/contents/{+path}","compare_url":"https://api.github.com/repos/sMusy/GitLink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sMusy/GitLink/merges","archive_url":"https://api.github.com/repos/sMusy/GitLink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sMusy/GitLink/downloads","issues_url":"https://api.github.com/repos/sMusy/GitLink/issues{/number}","pulls_url":"https://api.github.com/repos/sMusy/GitLink/pulls{/number}","milestones_url":"https://api.github.com/repos/sMusy/GitLink/milestones{/number}","notifications_url":"https://api.github.com/repos/sMusy/GitLink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sMusy/GitLink/labels{/name}","releases_url":"https://api.github.com/repos/sMusy/GitLink/releases{/id}","created_at":"2015-11-30T15:12:48Z","updated_at":"2015-11-30T15:12:49Z","pushed_at":"2015-12-06T18:41:00Z","git_url":"git://github.com/sMusy/GitLink.git","ssh_url":"git@github.com:sMusy/GitLink.git","clone_url":"https://github.com/sMusy/GitLink.git","svn_url":"https://github.com/sMusy/GitLink","homepage":"","size":7142,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"GitTools:develop","ref":"develop","sha":"fa353f63c49cf6acc630a46ed9263d8f19c771bc","user":{"login":"GitTools","id":11839771,"avatar_url":"https://avatars.githubusercontent.com/u/11839771?v=3","gravatar_id":"","url":"https://api.github.com/users/GitTools","html_url":"https://github.com/GitTools","followers_url":"https://api.github.com/users/GitTools/followers","following_url":"https://api.github.com/users/GitTools/following{/other_user}","gists_url":"https://api.github.com/users/GitTools/gists{/gist_id}","starred_url":"https://api.github.com/users/GitTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitTools/subscriptions","organizations_url":"https://api.github.com/users/GitTools/orgs","repos_url":"https://api.github.com/users/GitTools/repos","events_url":"https://api.github.com/users/GitTools/events{/privacy}","received_events_url":"https://api.github.com/users/GitTools/received_events","type":"Organization","site_admin":false},"repo":{"id":18791236,"name":"GitLink","full_name":"GitTools/GitLink","owner":{"login":"GitTools","id":11839771,"avatar_url":"https://avatars.githubusercontent.com/u/11839771?v=3","gravatar_id":"","url":"https://api.github.com/users/GitTools","html_url":"https://github.com/GitTools","followers_url":"https://api.github.com/users/GitTools/followers","following_url":"https://api.github.com/users/GitTools/following{/other_user}","gists_url":"https://api.github.com/users/GitTools/gists{/gist_id}","starred_url":"https://api.github.com/users/GitTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitTools/subscriptions","organizations_url":"https://api.github.com/users/GitTools/orgs","repos_url":"https://api.github.com/users/GitTools/repos","events_url":"https://api.github.com/users/GitTools/events{/privacy}","received_events_url":"https://api.github.com/users/GitTools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GitTools/GitLink","description":"Making .NET open source accessible!","fork":false,"url":"https://api.github.com/repos/GitTools/GitLink","forks_url":"https://api.github.com/repos/GitTools/GitLink/forks","keys_url":"https://api.github.com/repos/GitTools/GitLink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GitTools/GitLink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GitTools/GitLink/teams","hooks_url":"https://api.github.com/repos/GitTools/GitLink/hooks","issue_events_url":"https://api.github.com/repos/GitTools/GitLink/issues/events{/number}","events_url":"https://api.github.com/repos/GitTools/GitLink/events","assignees_url":"https://api.github.com/repos/GitTools/GitLink/assignees{/user}","branches_url":"https://api.github.com/repos/GitTools/GitLink/branches{/branch}","tags_url":"https://api.github.com/repos/GitTools/GitLink/tags","blobs_url":"https://api.github.com/repos/GitTools/GitLink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GitTools/GitLink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GitTools/GitLink/git/refs{/sha}","trees_url":"https://api.github.com/repos/GitTools/GitLink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GitTools/GitLink/statuses/{sha}","languages_url":"https://api.github.com/repos/GitTools/GitLink/languages","stargazers_url":"https://api.github.com/repos/GitTools/GitLink/stargazers","contributors_url":"https://api.github.com/repos/GitTools/GitLink/contributors","subscribers_url":"https://api.github.com/repos/GitTools/GitLink/subscribers","subscription_url":"https://api.github.com/repos/GitTools/GitLink/subscription","commits_url":"https://api.github.com/repos/GitTools/GitLink/commits{/sha}","git_commits_url":"https://api.github.com/repos/GitTools/GitLink/git/commits{/sha}","comments_url":"https://api.github.com/repos/GitTools/GitLink/comments{/number}","issue_comment_url":"https://api.github.com/repos/GitTools/GitLink/issues/comments{/number}","contents_url":"https://api.github.com/repos/GitTools/GitLink/contents/{+path}","compare_url":"https://api.github.com/repos/GitTools/GitLink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GitTools/GitLink/merges","archive_url":"https://api.github.com/repos/GitTools/GitLink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GitTools/GitLink/downloads","issues_url":"https://api.github.com/repos/GitTools/GitLink/issues{/number}","pulls_url":"https://api.github.com/repos/GitTools/GitLink/pulls{/number}","milestones_url":"https://api.github.com/repos/GitTools/GitLink/milestones{/number}","notifications_url":"https://api.github.com/repos/GitTools/GitLink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GitTools/GitLink/labels{/name}","releases_url":"https://api.github.com/repos/GitTools/GitLink/releases{/id}","created_at":"2014-04-15T07:29:39Z","updated_at":"2015-12-11T03:52:57Z","pushed_at":"2015-12-06T18:41:00Z","git_url":"git://github.com/GitTools/GitLink.git","ssh_url":"git@github.com:GitTools/GitLink.git","clone_url":"https://github.com/GitTools/GitLink.git","svn_url":"https://github.com/GitTools/GitLink","homepage":"","size":7148,"stargazers_count":172,"watchers_count":172,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":19,"forks":25,"open_issues":19,"watchers":172,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/GitTools/GitLink/pulls/73"},"html":{"href":"https://github.com/GitTools/GitLink/pull/73"},"issue":{"href":"https://api.github.com/repos/GitTools/GitLink/issues/73"},"comments":{"href":"https://api.github.com/repos/GitTools/GitLink/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/GitTools/GitLink/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/GitTools/GitLink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GitTools/GitLink/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/GitTools/GitLink/statuses/a741c1f0ed43afac8ddfb9deeaddee4400c24364"}}}}