{"action":"created","comment":{"url":"https://api.github.com/repos/gitlabhq/gitlab-shell/pulls/comments/50628910","id":50628910,"diff_hunk":"@@ -0,0 +1,36 @@\n+require_relative 'gitlab_init'\n+\n+class GitlabMergeRequestHook\n+  attr_reader :config, :repo_path, :changes\n+\n+  def initialize(repo_path, config, changes)\n+    @branch    = branch_name(changes)\n+    @config    = config\n+    @repo_path = repo_path\n+  end\n+\n+  def exec\n+    return if @branch.nil? || @branch == \"master\"\n+    puts\n+    puts \"To open a merge request for #{@branch}, enter in:\"\n+    puts \"\\t#{repo_url}\"\n+    puts\n+  end\n+\n+  private\n+\n+  def branch_name(changes)\n+    changes","path":"lib/gitlab_merge_request_hook.rb","position":23,"original_position":23,"commit_id":"7cb350f54d2d0693ccc8e1117bb14f4104cfd9bb","original_commit_id":"7cb350f54d2d0693ccc8e1117bb14f4104cfd9bb","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Avoid using `rescue` in its modifier form.","created_at":"2016-01-24T01:46:12Z","updated_at":"2016-01-24T01:46:12Z","html_url":"https://github.com/gitlabhq/gitlab-shell/pull/243#discussion_r50628910","pull_request_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/pulls/243","_links":{"self":{"href":"https://api.github.com/repos/gitlabhq/gitlab-shell/pulls/comments/50628910"},"html":{"href":"https://github.com/gitlabhq/gitlab-shell/pull/243#discussion_r50628910"},"pull_request":{"href":"https://api.github.com/repos/gitlabhq/gitlab-shell/pulls/243"}}},"pull_request":{"url":"https://api.github.com/repos/gitlabhq/gitlab-shell/pulls/243","id":56992243,"html_url":"https://github.com/gitlabhq/gitlab-shell/pull/243","diff_url":"https://github.com/gitlabhq/gitlab-shell/pull/243.diff","patch_url":"https://github.com/gitlabhq/gitlab-shell/pull/243.patch","issue_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/issues/243","number":243,"state":"open","locked":false,"title":"Add Merge Request url on post-receive hook","user":{"login":"duduribeiro","id":771411,"avatar_url":"https://avatars.githubusercontent.com/u/771411?v=3","gravatar_id":"","url":"https://api.github.com/users/duduribeiro","html_url":"https://github.com/duduribeiro","followers_url":"https://api.github.com/users/duduribeiro/followers","following_url":"https://api.github.com/users/duduribeiro/following{/other_user}","gists_url":"https://api.github.com/users/duduribeiro/gists{/gist_id}","starred_url":"https://api.github.com/users/duduribeiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duduribeiro/subscriptions","organizations_url":"https://api.github.com/users/duduribeiro/orgs","repos_url":"https://api.github.com/users/duduribeiro/repos","events_url":"https://api.github.com/users/duduribeiro/events{/privacy}","received_events_url":"https://api.github.com/users/duduribeiro/received_events","type":"User","site_admin":false},"body":"This changes add the option to print the merge request URL on terminal output after the user push a branch. Like bitbucket does. \r\n\r\nI don't know if this is a feature that gitlab want, but if yes, and this need changes, feel free to tell me. Thanks :beers: \r\n\r\n<img width=\"1254\" alt=\"screen shot 2016-01-23 at 10 18 29 pm\" src=\"https://cloud.githubusercontent.com/assets/771411/12533902/28989d72-c221-11e5-90ae-4b4028e5ba85.png\">\r\nIf this is a valid idea, maybe create a url to be more beauty in the terminal output.. =)","created_at":"2016-01-24T01:33:45Z","updated_at":"2016-01-24T01:46:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6cd0fc2db55c04d11e92b9a0f20c346aea3ecbd4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/pulls/243/commits","review_comments_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/pulls/243/comments","review_comment_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/issues/243/comments","statuses_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/statuses/7cb350f54d2d0693ccc8e1117bb14f4104cfd9bb","head":{"label":"duduribeiro:add_mr_url_on_hook","ref":"add_mr_url_on_hook","sha":"7cb350f54d2d0693ccc8e1117bb14f4104cfd9bb","user":{"login":"duduribeiro","id":771411,"avatar_url":"https://avatars.githubusercontent.com/u/771411?v=3","gravatar_id":"","url":"https://api.github.com/users/duduribeiro","html_url":"https://github.com/duduribeiro","followers_url":"https://api.github.com/users/duduribeiro/followers","following_url":"https://api.github.com/users/duduribeiro/following{/other_user}","gists_url":"https://api.github.com/users/duduribeiro/gists{/gist_id}","starred_url":"https://api.github.com/users/duduribeiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duduribeiro/subscriptions","organizations_url":"https://api.github.com/users/duduribeiro/orgs","repos_url":"https://api.github.com/users/duduribeiro/repos","events_url":"https://api.github.com/users/duduribeiro/events{/privacy}","received_events_url":"https://api.github.com/users/duduribeiro/received_events","type":"User","site_admin":false},"repo":{"id":50265551,"name":"gitlab-shell","full_name":"duduribeiro/gitlab-shell","owner":{"login":"duduribeiro","id":771411,"avatar_url":"https://avatars.githubusercontent.com/u/771411?v=3","gravatar_id":"","url":"https://api.github.com/users/duduribeiro","html_url":"https://github.com/duduribeiro","followers_url":"https://api.github.com/users/duduribeiro/followers","following_url":"https://api.github.com/users/duduribeiro/following{/other_user}","gists_url":"https://api.github.com/users/duduribeiro/gists{/gist_id}","starred_url":"https://api.github.com/users/duduribeiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duduribeiro/subscriptions","organizations_url":"https://api.github.com/users/duduribeiro/orgs","repos_url":"https://api.github.com/users/duduribeiro/repos","events_url":"https://api.github.com/users/duduribeiro/events{/privacy}","received_events_url":"https://api.github.com/users/duduribeiro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/duduribeiro/gitlab-shell","description":"Replacement for gitolite","fork":true,"url":"https://api.github.com/repos/duduribeiro/gitlab-shell","forks_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/forks","keys_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/teams","hooks_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/hooks","issue_events_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/issues/events{/number}","events_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/events","assignees_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/assignees{/user}","branches_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/branches{/branch}","tags_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/tags","blobs_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/git/refs{/sha}","trees_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/statuses/{sha}","languages_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/languages","stargazers_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/stargazers","contributors_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/contributors","subscribers_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/subscribers","subscription_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/subscription","commits_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/commits{/sha}","git_commits_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/git/commits{/sha}","comments_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/comments{/number}","issue_comment_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/issues/comments{/number}","contents_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/contents/{+path}","compare_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/merges","archive_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/downloads","issues_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/issues{/number}","pulls_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/pulls{/number}","milestones_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/milestones{/number}","notifications_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/labels{/name}","releases_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/releases{/id}","deployments_url":"https://api.github.com/repos/duduribeiro/gitlab-shell/deployments","created_at":"2016-01-24T00:32:35Z","updated_at":"2016-01-24T00:32:36Z","pushed_at":"2016-01-24T01:46:07Z","git_url":"git://github.com/duduribeiro/gitlab-shell.git","ssh_url":"git@github.com:duduribeiro/gitlab-shell.git","clone_url":"https://github.com/duduribeiro/gitlab-shell.git","svn_url":"https://github.com/duduribeiro/gitlab-shell","homepage":null,"size":469,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gitlabhq:master","ref":"master","sha":"82b3a4e8f70692ec679d880628fdb0f5844d42b9","user":{"login":"gitlabhq","id":1086321,"avatar_url":"https://avatars.githubusercontent.com/u/1086321?v=3","gravatar_id":"","url":"https://api.github.com/users/gitlabhq","html_url":"https://github.com/gitlabhq","followers_url":"https://api.github.com/users/gitlabhq/followers","following_url":"https://api.github.com/users/gitlabhq/following{/other_user}","gists_url":"https://api.github.com/users/gitlabhq/gists{/gist_id}","starred_url":"https://api.github.com/users/gitlabhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitlabhq/subscriptions","organizations_url":"https://api.github.com/users/gitlabhq/orgs","repos_url":"https://api.github.com/users/gitlabhq/repos","events_url":"https://api.github.com/users/gitlabhq/events{/privacy}","received_events_url":"https://api.github.com/users/gitlabhq/received_events","type":"Organization","site_admin":false},"repo":{"id":8003417,"name":"gitlab-shell","full_name":"gitlabhq/gitlab-shell","owner":{"login":"gitlabhq","id":1086321,"avatar_url":"https://avatars.githubusercontent.com/u/1086321?v=3","gravatar_id":"","url":"https://api.github.com/users/gitlabhq","html_url":"https://github.com/gitlabhq","followers_url":"https://api.github.com/users/gitlabhq/followers","following_url":"https://api.github.com/users/gitlabhq/following{/other_user}","gists_url":"https://api.github.com/users/gitlabhq/gists{/gist_id}","starred_url":"https://api.github.com/users/gitlabhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitlabhq/subscriptions","organizations_url":"https://api.github.com/users/gitlabhq/orgs","repos_url":"https://api.github.com/users/gitlabhq/repos","events_url":"https://api.github.com/users/gitlabhq/events{/privacy}","received_events_url":"https://api.github.com/users/gitlabhq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gitlabhq/gitlab-shell","description":"Replacement for gitolite","fork":false,"url":"https://api.github.com/repos/gitlabhq/gitlab-shell","forks_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/forks","keys_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/teams","hooks_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/hooks","issue_events_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/issues/events{/number}","events_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/events","assignees_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/assignees{/user}","branches_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/branches{/branch}","tags_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/tags","blobs_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/git/refs{/sha}","trees_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/statuses/{sha}","languages_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/languages","stargazers_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/stargazers","contributors_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/contributors","subscribers_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/subscribers","subscription_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/subscription","commits_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/commits{/sha}","git_commits_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/git/commits{/sha}","comments_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/comments{/number}","issue_comment_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/issues/comments{/number}","contents_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/contents/{+path}","compare_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/merges","archive_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/downloads","issues_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/issues{/number}","pulls_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/pulls{/number}","milestones_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/milestones{/number}","notifications_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/labels{/name}","releases_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/releases{/id}","deployments_url":"https://api.github.com/repos/gitlabhq/gitlab-shell/deployments","created_at":"2013-02-04T08:11:01Z","updated_at":"2016-01-19T03:17:22Z","pushed_at":"2016-01-24T01:46:08Z","git_url":"git://github.com/gitlabhq/gitlab-shell.git","ssh_url":"git@github.com:gitlabhq/gitlab-shell.git","clone_url":"https://github.com/gitlabhq/gitlab-shell.git","svn_url":"https://github.com/gitlabhq/gitlab-shell","homepage":null,"size":608,"stargazers_count":363,"watchers_count":363,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":238,"mirror_url":null,"open_issues_count":80,"forks":238,"open_issues":80,"watchers":363,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gitlabhq/gitlab-shell/pulls/243"},"html":{"href":"https://github.com/gitlabhq/gitlab-shell/pull/243"},"issue":{"href":"https://api.github.com/repos/gitlabhq/gitlab-shell/issues/243"},"comments":{"href":"https://api.github.com/repos/gitlabhq/gitlab-shell/issues/243/comments"},"review_comments":{"href":"https://api.github.com/repos/gitlabhq/gitlab-shell/pulls/243/comments"},"review_comment":{"href":"https://api.github.com/repos/gitlabhq/gitlab-shell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gitlabhq/gitlab-shell/pulls/243/commits"},"statuses":{"href":"https://api.github.com/repos/gitlabhq/gitlab-shell/statuses/7cb350f54d2d0693ccc8e1117bb14f4104cfd9bb"}}}}