{"action":"created","comment":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/52962063","id":52962063,"diff_hunk":"@@ -216,43 +216,58 @@ def import_from_git(url: nil, branch: 'HEAD', path: 'fastlane/Fastfile')\n       UI.user_error!(\"Please pass a path to the `import_from_git` action\") if url.to_s.length == 0\n \n       Actions.execute_action('import_from_git') do\n-        require 'tmpdir'\n-\n         collector.did_launch_action(:import_from_git)\n \n-        # Checkout the repo\n-        repo_name = url.split(\"/\").last\n-\n-        tmp_path = Dir.mktmpdir(\"fl_clone\")\n-        clone_folder = File.join(tmp_path, repo_name)\n-\n-        branch_option = \"\"\n-        branch_option = \"--branch #{branch}\" if branch != 'HEAD'\n-\n-        clone_command = \"git clone '#{url}' '#{clone_folder}' --depth 1 -n #{branch_option}\"\n-\n-        UI.message \"Cloning remote git repo...\"\n-        Actions.sh(clone_command)\n-\n-        Actions.sh(\"cd '#{clone_folder}' && git checkout #{branch} '#{path}'\")\n+        fetcher = GitFetcher.new\n+        fetcher.clone(url: url, branch: branch, path: path)\n \n         # We also want to check out all the local actions of this fastlane setup\n         containing = path.split(File::SEPARATOR)[0..-2]\n-        containing = \".\" if containing.count == 0\n-        actions_folder = File.join(containing, \"actions\")\n+        containing = \".\" if containing.count == 0 # to support the local fastlane deployment too\n+\n+        folder = File.join(containing, \"actions\")\n         begin\n-          Actions.sh(\"cd '#{clone_folder}' && git checkout #{branch} '#{actions_folder}'\")\n-        rescue\n-          # We don't care about a failure here, as local actions are optional\n+          Dir.chdir(self.clone_folder) do\n+            Actions.sh(\"git checkout #{branch} '#{folder}'\")\n+          end\n+        rescue => ex\n+          UI.verbose(ex.to_s) # We don't care about a failure here, as local actions are optional\n         end\n-\n         import(File.join(clone_folder, path))\n \n-        if Dir.exist?(clone_folder)\n-          # We want to re-clone if the folder already exists\n-          UI.message \"Clearing the git repo...\"\n-          Actions.sh(\"rm -rf '#{tmp_path}'\")\n+        fetcher.clear\n+      end\n+    end\n+\n+    def load_plugin(url: nil, path: nil, branch: 'HEAD')\n+      UI.user_error!(\"Make sure the plugin has a `.rb` extension\") if path && !path.end_with?(\".rb\")","path":"lib/fastlane/fast_file.rb","position":55,"original_position":55,"commit_id":"fd96f39f8ade43e35e85d36bb9f1469810b2df3b","original_commit_id":"fd96f39f8ade43e35e85d36bb9f1469810b2df3b","user":{"login":"i2amsam","id":665326,"avatar_url":"https://avatars.githubusercontent.com/u/665326?v=3","gravatar_id":"","url":"https://api.github.com/users/i2amsam","html_url":"https://github.com/i2amsam","followers_url":"https://api.github.com/users/i2amsam/followers","following_url":"https://api.github.com/users/i2amsam/following{/other_user}","gists_url":"https://api.github.com/users/i2amsam/gists{/gist_id}","starred_url":"https://api.github.com/users/i2amsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/i2amsam/subscriptions","organizations_url":"https://api.github.com/users/i2amsam/orgs","repos_url":"https://api.github.com/users/i2amsam/repos","events_url":"https://api.github.com/users/i2amsam/events{/privacy}","received_events_url":"https://api.github.com/users/i2amsam/received_events","type":"User","site_admin":false},"body":"Worth logging metrics here on which plugin are being used?  Useful for debugging crashes which may be caused by multiple plugins together and roadmap planning to see which remote ones are most useful.","created_at":"2016-02-16T02:13:24Z","updated_at":"2016-02-16T02:13:24Z","html_url":"https://github.com/fastlane/fastlane/pull/1320#discussion_r52962063","pull_request_url":"https://api.github.com/repos/fastlane/fastlane/pulls/1320","_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/52962063"},"html":{"href":"https://github.com/fastlane/fastlane/pull/1320#discussion_r52962063"},"pull_request":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/1320"}}},"pull_request":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/1320","id":59404486,"html_url":"https://github.com/fastlane/fastlane/pull/1320","diff_url":"https://github.com/fastlane/fastlane/pull/1320.diff","patch_url":"https://github.com/fastlane/fastlane/pull/1320.patch","issue_url":"https://api.github.com/repos/fastlane/fastlane/issues/1320","number":1320,"state":"open","locked":false,"title":"Added plugin system to fastlane","user":{"login":"KrauseFx","id":869950,"avatar_url":"https://avatars.githubusercontent.com/u/869950?v=3","gravatar_id":"","url":"https://api.github.com/users/KrauseFx","html_url":"https://github.com/KrauseFx","followers_url":"https://api.github.com/users/KrauseFx/followers","following_url":"https://api.github.com/users/KrauseFx/following{/other_user}","gists_url":"https://api.github.com/users/KrauseFx/gists{/gist_id}","starred_url":"https://api.github.com/users/KrauseFx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrauseFx/subscriptions","organizations_url":"https://api.github.com/users/KrauseFx/orgs","repos_url":"https://api.github.com/users/KrauseFx/repos","events_url":"https://api.github.com/users/KrauseFx/events{/privacy}","received_events_url":"https://api.github.com/users/KrauseFx/received_events","type":"User","site_admin":false},"body":"- New `load_plugin` action\r\n- Extracted temporary git clone into `git_fetcher.rb` as it's used by the `import_from_git` action too\r\n- Moved all local action documentation into its own file\r\n- Moved `Fastfile` detection to a central place\r\n- Added tests for the plugin integration","created_at":"2016-02-15T19:26:41Z","updated_at":"2016-02-16T02:13:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc3e67b944df435cf4259cfa5e893554846bed69","assignee":{"login":"i2amsam","id":665326,"avatar_url":"https://avatars.githubusercontent.com/u/665326?v=3","gravatar_id":"","url":"https://api.github.com/users/i2amsam","html_url":"https://github.com/i2amsam","followers_url":"https://api.github.com/users/i2amsam/followers","following_url":"https://api.github.com/users/i2amsam/following{/other_user}","gists_url":"https://api.github.com/users/i2amsam/gists{/gist_id}","starred_url":"https://api.github.com/users/i2amsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/i2amsam/subscriptions","organizations_url":"https://api.github.com/users/i2amsam/orgs","repos_url":"https://api.github.com/users/i2amsam/repos","events_url":"https://api.github.com/users/i2amsam/events{/privacy}","received_events_url":"https://api.github.com/users/i2amsam/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/fastlane/fastlane/pulls/1320/commits","review_comments_url":"https://api.github.com/repos/fastlane/fastlane/pulls/1320/comments","review_comment_url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fastlane/fastlane/issues/1320/comments","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/fd96f39f8ade43e35e85d36bb9f1469810b2df3b","head":{"label":"fastlane:plugins","ref":"plugins","sha":"fd96f39f8ade43e35e85d36bb9f1469810b2df3b","user":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"repo":{"id":27442967,"name":"fastlane","full_name":"fastlane/fastlane","owner":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fastlane/fastlane","description":"Connect all iOS deployment tools into one streamlined workflow","fork":false,"url":"https://api.github.com/repos/fastlane/fastlane","forks_url":"https://api.github.com/repos/fastlane/fastlane/forks","keys_url":"https://api.github.com/repos/fastlane/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastlane/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastlane/fastlane/teams","hooks_url":"https://api.github.com/repos/fastlane/fastlane/hooks","issue_events_url":"https://api.github.com/repos/fastlane/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/fastlane/fastlane/events","assignees_url":"https://api.github.com/repos/fastlane/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/fastlane/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/fastlane/fastlane/tags","blobs_url":"https://api.github.com/repos/fastlane/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastlane/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastlane/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastlane/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/fastlane/fastlane/languages","stargazers_url":"https://api.github.com/repos/fastlane/fastlane/stargazers","contributors_url":"https://api.github.com/repos/fastlane/fastlane/contributors","subscribers_url":"https://api.github.com/repos/fastlane/fastlane/subscribers","subscription_url":"https://api.github.com/repos/fastlane/fastlane/subscription","commits_url":"https://api.github.com/repos/fastlane/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastlane/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastlane/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastlane/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastlane/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/fastlane/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastlane/fastlane/merges","archive_url":"https://api.github.com/repos/fastlane/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastlane/fastlane/downloads","issues_url":"https://api.github.com/repos/fastlane/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/fastlane/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/fastlane/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/fastlane/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastlane/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/fastlane/fastlane/releases{/id}","deployments_url":"https://api.github.com/repos/fastlane/fastlane/deployments","created_at":"2014-12-02T17:00:38Z","updated_at":"2016-02-16T01:21:15Z","pushed_at":"2016-02-15T22:48:36Z","git_url":"git://github.com/fastlane/fastlane.git","ssh_url":"git@github.com:fastlane/fastlane.git","clone_url":"https://github.com/fastlane/fastlane.git","svn_url":"https://github.com/fastlane/fastlane","homepage":"https://fastlane.tools","size":6915,"stargazers_count":5647,"watchers_count":5647,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":641,"mirror_url":null,"open_issues_count":228,"forks":641,"open_issues":228,"watchers":5647,"default_branch":"master"}},"base":{"label":"fastlane:master","ref":"master","sha":"958b99a7aa6c8120cf9e7a16a83e27bb1b5b1439","user":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"repo":{"id":27442967,"name":"fastlane","full_name":"fastlane/fastlane","owner":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fastlane/fastlane","description":"Connect all iOS deployment tools into one streamlined workflow","fork":false,"url":"https://api.github.com/repos/fastlane/fastlane","forks_url":"https://api.github.com/repos/fastlane/fastlane/forks","keys_url":"https://api.github.com/repos/fastlane/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastlane/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastlane/fastlane/teams","hooks_url":"https://api.github.com/repos/fastlane/fastlane/hooks","issue_events_url":"https://api.github.com/repos/fastlane/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/fastlane/fastlane/events","assignees_url":"https://api.github.com/repos/fastlane/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/fastlane/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/fastlane/fastlane/tags","blobs_url":"https://api.github.com/repos/fastlane/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastlane/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastlane/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastlane/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/fastlane/fastlane/languages","stargazers_url":"https://api.github.com/repos/fastlane/fastlane/stargazers","contributors_url":"https://api.github.com/repos/fastlane/fastlane/contributors","subscribers_url":"https://api.github.com/repos/fastlane/fastlane/subscribers","subscription_url":"https://api.github.com/repos/fastlane/fastlane/subscription","commits_url":"https://api.github.com/repos/fastlane/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastlane/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastlane/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastlane/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastlane/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/fastlane/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastlane/fastlane/merges","archive_url":"https://api.github.com/repos/fastlane/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastlane/fastlane/downloads","issues_url":"https://api.github.com/repos/fastlane/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/fastlane/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/fastlane/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/fastlane/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastlane/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/fastlane/fastlane/releases{/id}","deployments_url":"https://api.github.com/repos/fastlane/fastlane/deployments","created_at":"2014-12-02T17:00:38Z","updated_at":"2016-02-16T01:21:15Z","pushed_at":"2016-02-15T22:48:36Z","git_url":"git://github.com/fastlane/fastlane.git","ssh_url":"git@github.com:fastlane/fastlane.git","clone_url":"https://github.com/fastlane/fastlane.git","svn_url":"https://github.com/fastlane/fastlane","homepage":"https://fastlane.tools","size":6915,"stargazers_count":5647,"watchers_count":5647,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":641,"mirror_url":null,"open_issues_count":228,"forks":641,"open_issues":228,"watchers":5647,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/1320"},"html":{"href":"https://github.com/fastlane/fastlane/pull/1320"},"issue":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/1320"},"comments":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/1320/comments"},"review_comments":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/1320/comments"},"review_comment":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/1320/commits"},"statuses":{"href":"https://api.github.com/repos/fastlane/fastlane/statuses/fd96f39f8ade43e35e85d36bb9f1469810b2df3b"}}}}