{"action":"created","comment":{"url":"https://api.github.com/repos/xonsh/xonsh/pulls/comments/68332500","id":68332500,"diff_hunk":"@@ -1634,6 +1647,38 @@ def lazyget(self, key, default=None):\n         \"\"\"A lazy value getter.\"\"\"\n         return self._cmds_cache.get(key, default)\n \n+    def locate_binary(self, name):\n+        \"\"\"Locates an executable on the file system.\"\"\"\n+\n+        if ON_WINDOWS:\n+            # Windows users expect to be able to execute files in the same\n+            # directory without `./`\n+            cwd = _get_cwd()\n+\n+            local_bins = [full_name for full_name in self.get_possible_names(name)\n+                          if os.path.isfile(full_name)]\n+            if local_bins:\n+                return os.path.abspath(os.path.relpath(local_bins[0], cwd))\n+\n+        possibilities = self.get_possible_names(name)\n+        matches = possibilities & self.all_commands.keys()\n+\n+        if matches:\n+            return self.all_commands[matches.pop()][0]","path":"xonsh/tools.py","position":70,"original_position":70,"commit_id":"c8135080fd96878ea8dde82065c24734a2771a9b","original_commit_id":"c8135080fd96878ea8dde82065c24734a2771a9b","user":{"login":"BYK","id":126780,"avatar_url":"https://avatars.githubusercontent.com/u/126780?v=3","gravatar_id":"","url":"https://api.github.com/users/BYK","html_url":"https://github.com/BYK","followers_url":"https://api.github.com/users/BYK/followers","following_url":"https://api.github.com/users/BYK/following{/other_user}","gists_url":"https://api.github.com/users/BYK/gists{/gist_id}","starred_url":"https://api.github.com/users/BYK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BYK/subscriptions","organizations_url":"https://api.github.com/users/BYK/orgs","repos_url":"https://api.github.com/users/BYK/repos","events_url":"https://api.github.com/users/BYK/events{/privacy}","received_events_url":"https://api.github.com/users/BYK/received_events","type":"User","site_admin":false},"body":"Good catch, will fix.","created_at":"2016-06-23T23:23:50Z","updated_at":"2016-06-23T23:23:50Z","html_url":"https://github.com/xonsh/xonsh/pull/1329#discussion_r68332500","pull_request_url":"https://api.github.com/repos/xonsh/xonsh/pulls/1329","_links":{"self":{"href":"https://api.github.com/repos/xonsh/xonsh/pulls/comments/68332500"},"html":{"href":"https://github.com/xonsh/xonsh/pull/1329#discussion_r68332500"},"pull_request":{"href":"https://api.github.com/repos/xonsh/xonsh/pulls/1329"}}},"pull_request":{"url":"https://api.github.com/repos/xonsh/xonsh/pulls/1329","id":75035009,"html_url":"https://github.com/xonsh/xonsh/pull/1329","diff_url":"https://github.com/xonsh/xonsh/pull/1329.diff","patch_url":"https://github.com/xonsh/xonsh/pull/1329.patch","issue_url":"https://api.github.com/repos/xonsh/xonsh/issues/1329","number":1329,"state":"open","locked":false,"title":"Make CommandsCache play well with Windows","user":{"login":"BYK","id":126780,"avatar_url":"https://avatars.githubusercontent.com/u/126780?v=3","gravatar_id":"","url":"https://api.github.com/users/BYK","html_url":"https://github.com/BYK","followers_url":"https://api.github.com/users/BYK/followers","following_url":"https://api.github.com/users/BYK/following{/other_user}","gists_url":"https://api.github.com/users/BYK/gists{/gist_id}","starred_url":"https://api.github.com/users/BYK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BYK/subscriptions","organizations_url":"https://api.github.com/users/BYK/orgs","repos_url":"https://api.github.com/users/BYK/repos","events_url":"https://api.github.com/users/BYK/events{/privacy}","received_events_url":"https://api.github.com/users/BYK/received_events","type":"User","site_admin":false},"body":"Currently when you do `'git' in builtins.__xonsh_commands_cache__` on Windows you get `False` since the version stored in commands cache is `GIT.EXE`.\r\n\r\nThis patch amends its getter methods to respond to any version available on Windows. This fixes `curr_branch` not working at all on Windows platform since it only looks for `'git'` in command cache and bailds if its not there.","created_at":"2016-06-23T22:02:39Z","updated_at":"2016-06-23T23:23:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f7871c8791f11159dc1979f78a97f7bd28603d7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/xonsh/xonsh/pulls/1329/commits","review_comments_url":"https://api.github.com/repos/xonsh/xonsh/pulls/1329/comments","review_comment_url":"https://api.github.com/repos/xonsh/xonsh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xonsh/xonsh/issues/1329/comments","statuses_url":"https://api.github.com/repos/xonsh/xonsh/statuses/c8135080fd96878ea8dde82065c24734a2771a9b","head":{"label":"xonsh:cc-windows","ref":"cc-windows","sha":"c8135080fd96878ea8dde82065c24734a2771a9b","user":{"login":"xonsh","id":17418188,"avatar_url":"https://avatars.githubusercontent.com/u/17418188?v=3","gravatar_id":"","url":"https://api.github.com/users/xonsh","html_url":"https://github.com/xonsh","followers_url":"https://api.github.com/users/xonsh/followers","following_url":"https://api.github.com/users/xonsh/following{/other_user}","gists_url":"https://api.github.com/users/xonsh/gists{/gist_id}","starred_url":"https://api.github.com/users/xonsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xonsh/subscriptions","organizations_url":"https://api.github.com/users/xonsh/orgs","repos_url":"https://api.github.com/users/xonsh/repos","events_url":"https://api.github.com/users/xonsh/events{/privacy}","received_events_url":"https://api.github.com/users/xonsh/received_events","type":"Organization","site_admin":false},"repo":{"id":29620400,"name":"xonsh","full_name":"xonsh/xonsh","owner":{"login":"xonsh","id":17418188,"avatar_url":"https://avatars.githubusercontent.com/u/17418188?v=3","gravatar_id":"","url":"https://api.github.com/users/xonsh","html_url":"https://github.com/xonsh","followers_url":"https://api.github.com/users/xonsh/followers","following_url":"https://api.github.com/users/xonsh/following{/other_user}","gists_url":"https://api.github.com/users/xonsh/gists{/gist_id}","starred_url":"https://api.github.com/users/xonsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xonsh/subscriptions","organizations_url":"https://api.github.com/users/xonsh/orgs","repos_url":"https://api.github.com/users/xonsh/repos","events_url":"https://api.github.com/users/xonsh/events{/privacy}","received_events_url":"https://api.github.com/users/xonsh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xonsh/xonsh","description":"xonsh is a Python-ish, BASHwards-facing shell.","fork":false,"url":"https://api.github.com/repos/xonsh/xonsh","forks_url":"https://api.github.com/repos/xonsh/xonsh/forks","keys_url":"https://api.github.com/repos/xonsh/xonsh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xonsh/xonsh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xonsh/xonsh/teams","hooks_url":"https://api.github.com/repos/xonsh/xonsh/hooks","issue_events_url":"https://api.github.com/repos/xonsh/xonsh/issues/events{/number}","events_url":"https://api.github.com/repos/xonsh/xonsh/events","assignees_url":"https://api.github.com/repos/xonsh/xonsh/assignees{/user}","branches_url":"https://api.github.com/repos/xonsh/xonsh/branches{/branch}","tags_url":"https://api.github.com/repos/xonsh/xonsh/tags","blobs_url":"https://api.github.com/repos/xonsh/xonsh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xonsh/xonsh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xonsh/xonsh/git/refs{/sha}","trees_url":"https://api.github.com/repos/xonsh/xonsh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xonsh/xonsh/statuses/{sha}","languages_url":"https://api.github.com/repos/xonsh/xonsh/languages","stargazers_url":"https://api.github.com/repos/xonsh/xonsh/stargazers","contributors_url":"https://api.github.com/repos/xonsh/xonsh/contributors","subscribers_url":"https://api.github.com/repos/xonsh/xonsh/subscribers","subscription_url":"https://api.github.com/repos/xonsh/xonsh/subscription","commits_url":"https://api.github.com/repos/xonsh/xonsh/commits{/sha}","git_commits_url":"https://api.github.com/repos/xonsh/xonsh/git/commits{/sha}","comments_url":"https://api.github.com/repos/xonsh/xonsh/comments{/number}","issue_comment_url":"https://api.github.com/repos/xonsh/xonsh/issues/comments{/number}","contents_url":"https://api.github.com/repos/xonsh/xonsh/contents/{+path}","compare_url":"https://api.github.com/repos/xonsh/xonsh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xonsh/xonsh/merges","archive_url":"https://api.github.com/repos/xonsh/xonsh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xonsh/xonsh/downloads","issues_url":"https://api.github.com/repos/xonsh/xonsh/issues{/number}","pulls_url":"https://api.github.com/repos/xonsh/xonsh/pulls{/number}","milestones_url":"https://api.github.com/repos/xonsh/xonsh/milestones{/number}","notifications_url":"https://api.github.com/repos/xonsh/xonsh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xonsh/xonsh/labels{/name}","releases_url":"https://api.github.com/repos/xonsh/xonsh/releases{/id}","deployments_url":"https://api.github.com/repos/xonsh/xonsh/deployments","created_at":"2015-01-21T22:05:27Z","updated_at":"2016-06-23T19:20:14Z","pushed_at":"2016-06-23T22:46:19Z","git_url":"git://github.com/xonsh/xonsh.git","ssh_url":"git@github.com:xonsh/xonsh.git","clone_url":"https://github.com/xonsh/xonsh.git","svn_url":"https://github.com/xonsh/xonsh","homepage":"http://xon.sh","size":6972,"stargazers_count":1535,"watchers_count":1535,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":152,"mirror_url":null,"open_issues_count":234,"forks":152,"open_issues":234,"watchers":1535,"default_branch":"master"}},"base":{"label":"xonsh:master","ref":"master","sha":"ecbcdac2d33c7e01d9c3d52c8df6244d04641a7b","user":{"login":"xonsh","id":17418188,"avatar_url":"https://avatars.githubusercontent.com/u/17418188?v=3","gravatar_id":"","url":"https://api.github.com/users/xonsh","html_url":"https://github.com/xonsh","followers_url":"https://api.github.com/users/xonsh/followers","following_url":"https://api.github.com/users/xonsh/following{/other_user}","gists_url":"https://api.github.com/users/xonsh/gists{/gist_id}","starred_url":"https://api.github.com/users/xonsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xonsh/subscriptions","organizations_url":"https://api.github.com/users/xonsh/orgs","repos_url":"https://api.github.com/users/xonsh/repos","events_url":"https://api.github.com/users/xonsh/events{/privacy}","received_events_url":"https://api.github.com/users/xonsh/received_events","type":"Organization","site_admin":false},"repo":{"id":29620400,"name":"xonsh","full_name":"xonsh/xonsh","owner":{"login":"xonsh","id":17418188,"avatar_url":"https://avatars.githubusercontent.com/u/17418188?v=3","gravatar_id":"","url":"https://api.github.com/users/xonsh","html_url":"https://github.com/xonsh","followers_url":"https://api.github.com/users/xonsh/followers","following_url":"https://api.github.com/users/xonsh/following{/other_user}","gists_url":"https://api.github.com/users/xonsh/gists{/gist_id}","starred_url":"https://api.github.com/users/xonsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xonsh/subscriptions","organizations_url":"https://api.github.com/users/xonsh/orgs","repos_url":"https://api.github.com/users/xonsh/repos","events_url":"https://api.github.com/users/xonsh/events{/privacy}","received_events_url":"https://api.github.com/users/xonsh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xonsh/xonsh","description":"xonsh is a Python-ish, BASHwards-facing shell.","fork":false,"url":"https://api.github.com/repos/xonsh/xonsh","forks_url":"https://api.github.com/repos/xonsh/xonsh/forks","keys_url":"https://api.github.com/repos/xonsh/xonsh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xonsh/xonsh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xonsh/xonsh/teams","hooks_url":"https://api.github.com/repos/xonsh/xonsh/hooks","issue_events_url":"https://api.github.com/repos/xonsh/xonsh/issues/events{/number}","events_url":"https://api.github.com/repos/xonsh/xonsh/events","assignees_url":"https://api.github.com/repos/xonsh/xonsh/assignees{/user}","branches_url":"https://api.github.com/repos/xonsh/xonsh/branches{/branch}","tags_url":"https://api.github.com/repos/xonsh/xonsh/tags","blobs_url":"https://api.github.com/repos/xonsh/xonsh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xonsh/xonsh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xonsh/xonsh/git/refs{/sha}","trees_url":"https://api.github.com/repos/xonsh/xonsh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xonsh/xonsh/statuses/{sha}","languages_url":"https://api.github.com/repos/xonsh/xonsh/languages","stargazers_url":"https://api.github.com/repos/xonsh/xonsh/stargazers","contributors_url":"https://api.github.com/repos/xonsh/xonsh/contributors","subscribers_url":"https://api.github.com/repos/xonsh/xonsh/subscribers","subscription_url":"https://api.github.com/repos/xonsh/xonsh/subscription","commits_url":"https://api.github.com/repos/xonsh/xonsh/commits{/sha}","git_commits_url":"https://api.github.com/repos/xonsh/xonsh/git/commits{/sha}","comments_url":"https://api.github.com/repos/xonsh/xonsh/comments{/number}","issue_comment_url":"https://api.github.com/repos/xonsh/xonsh/issues/comments{/number}","contents_url":"https://api.github.com/repos/xonsh/xonsh/contents/{+path}","compare_url":"https://api.github.com/repos/xonsh/xonsh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xonsh/xonsh/merges","archive_url":"https://api.github.com/repos/xonsh/xonsh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xonsh/xonsh/downloads","issues_url":"https://api.github.com/repos/xonsh/xonsh/issues{/number}","pulls_url":"https://api.github.com/repos/xonsh/xonsh/pulls{/number}","milestones_url":"https://api.github.com/repos/xonsh/xonsh/milestones{/number}","notifications_url":"https://api.github.com/repos/xonsh/xonsh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xonsh/xonsh/labels{/name}","releases_url":"https://api.github.com/repos/xonsh/xonsh/releases{/id}","deployments_url":"https://api.github.com/repos/xonsh/xonsh/deployments","created_at":"2015-01-21T22:05:27Z","updated_at":"2016-06-23T19:20:14Z","pushed_at":"2016-06-23T22:46:19Z","git_url":"git://github.com/xonsh/xonsh.git","ssh_url":"git@github.com:xonsh/xonsh.git","clone_url":"https://github.com/xonsh/xonsh.git","svn_url":"https://github.com/xonsh/xonsh","homepage":"http://xon.sh","size":6972,"stargazers_count":1535,"watchers_count":1535,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":152,"mirror_url":null,"open_issues_count":234,"forks":152,"open_issues":234,"watchers":1535,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xonsh/xonsh/pulls/1329"},"html":{"href":"https://github.com/xonsh/xonsh/pull/1329"},"issue":{"href":"https://api.github.com/repos/xonsh/xonsh/issues/1329"},"comments":{"href":"https://api.github.com/repos/xonsh/xonsh/issues/1329/comments"},"review_comments":{"href":"https://api.github.com/repos/xonsh/xonsh/pulls/1329/comments"},"review_comment":{"href":"https://api.github.com/repos/xonsh/xonsh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xonsh/xonsh/pulls/1329/commits"},"statuses":{"href":"https://api.github.com/repos/xonsh/xonsh/statuses/c8135080fd96878ea8dde82065c24734a2771a9b"}}}}
{"actor":{"display_login":"BYK"}}