GitHub PullRequestReviewCommentEvent at 2014-11-14 16:08:13
Repository: docker
Actor: tiborvass
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/20367597","id":20367597,"diff_hunk":"@@ -0,0 +1,91 @@\n+// +build windows\n+\n+package term\n+\n+type State struct {\n+\tmode uint32\n+}\n+\n+type Winsize struct {\n+\tHeight uint16\n+\tWidth  uint16\n+\tx      uint16\n+\ty      uint16\n+}\n+\n+func GetWinsize(fd uintptr) (*Winsize, error) {\n+\tws := &Winsize{}\n+\tvar info *CONSOLE_SCREEN_BUFFER_INFO\n+\tinfo, err := GetConsoleScreenBufferInfo(fd)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\tws.Height = uint16(info.srWindow.Right - info.srWindow.Left + 1)\n+\tws.Width = uint16(info.srWindow.Bottom - info.srWindow.Top + 1)\n+\n+\tws.x = 0 // todo azlinux -- this is the pixel size of the Window, and not currently used by any caller\n+\tws.y = 0\n+\n+\treturn ws, nil\n+}\n+\n+func SetWinsize(fd uintptr, ws *Winsize) error {\n+\treturn nil\n+}\n+\n+// IsTerminal returns true if the given file descriptor is a terminal.\n+func IsTerminal(fd uintptr) bool {\n+\t_, e := GetConsoleMode(fd)\n+\treturn e == nil\n+}\n+\n+// Restore restores the terminal connected to the given file descriptor to a\n+// previous state.\n+func RestoreTerminal(fd uintptr, state *State) error {\n+\terr := SetConsoleMode(fd, state.mode)\n+\treturn err\n+}\n+\n+func SaveState(fd uintptr) (*State, error) {\n+\tmode, e := GetConsoleMode(fd)\n+\tif e != nil {\n+\t\treturn nil, e\n+\t}\n+\treturn &State{mode}, nil\n+}\n+\n+// see http://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx for these flag settings\n+func DisableEcho(fd uintptr, state *State) error {\n+\tstate.mode &^= (ENABLE_ECHO_INPUT)\n+\tstate.mode |= (ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT)\n+\te := SetConsoleMode(fd, state.mode)","path":"pkg/term/term_windows.go","position":61,"original_position":61,"commit_id":"ca6c3a791e368a76e58932e1c181790779bd5dcc","original_commit_id":"ca6c3a791e368a76e58932e1c181790779bd5dcc","user":{"login":"tiborvass","id":827131,"avatar_url":"https://avatars.githubusercontent.com/u/827131?v=3","gravatar_id":"","url":"https://api.github.com/users/tiborvass","html_url":"https://github.com/tiborvass","followers_url":"https://api.github.com/users/tiborvass/followers","following_url":"https://api.github.com/users/tiborvass/following{/other_user}","gists_url":"https://api.github.com/users/tiborvass/gists{/gist_id}","starred_url":"https://api.github.com/users/tiborvass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiborvass/subscriptions","organizations_url":"https://api.github.com/users/tiborvass/orgs","repos_url":"https://api.github.com/users/tiborvass/repos","events_url":"https://api.github.com/users/tiborvass/events{/privacy}","received_events_url":"https://api.github.com/users/tiborvass/received_events","type":"User","site_admin":false},"body":"same here, can return directly","created_at":"2014-11-14T16:08:13Z","updated_at":"2014-11-14T16:08:13Z","html_url":"https://github.com/docker/docker/pull/9113#discussion_r20367597","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/9113","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/20367597"},"html":{"href":"https://github.com/docker/docker/pull/9113#discussion_r20367597"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/9113"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/9113","id":24271906,"html_url":"https://github.com/docker/docker/pull/9113","diff_url":"https://github.com/docker/docker/pull/9113.diff","patch_url":"https://github.com/docker/docker/pull/9113.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/9113","number":9113,"state":"open","locked":false,"title":"Windows port of Docker Client","user":{"login":"ahmetalpbalkan","id":159209,"avatar_url":"https://avatars.githubusercontent.com/u/159209?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmetalpbalkan","html_url":"https://github.com/ahmetalpbalkan","followers_url":"https://api.github.com/users/ahmetalpbalkan/followers","following_url":"https://api.github.com/users/ahmetalpbalkan/following{/other_user}","gists_url":"https://api.github.com/users/ahmetalpbalkan/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmetalpbalkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmetalpbalkan/subscriptions","organizations_url":"https://api.github.com/users/ahmetalpbalkan/orgs","repos_url":"https://api.github.com/users/ahmetalpbalkan/repos","events_url":"https://api.github.com/users/ahmetalpbalkan/events{/privacy}","received_events_url":"https://api.github.com/users/ahmetalpbalkan/received_events","type":"User","site_admin":false},"body":"### Introduction\r\n\r\nThis pull request contains the set of changes to compile and get the Docker client working on Microsoft Windows.\r\n\r\nChanges were mostly around `pkg/term` to get the `docker attach` and other TTY-involving parts working on Windows terminals, `pkg/archive` and `utils` which rely on Unix-specfic calls or structures like stat and other things like home directory or path separators.\r\n\r\nWe haven't gotten the CLI integration tests running on Windows, yet, therefore functionality is mostly verified manually (more about this below). There are known bugs, which we are looking forward to fix very soon.\r\n\r\nSince some of the client code uses packages which contains daemon code (and therefore closely coupled to Linux), we had to provide alternative implementations to those using Go build tags. Those functions mostly return errors when they are called because they shouldn't be called on client code paths.\r\n\r\nRunning `make cross` now produces 386/amd64 versions of `docker.exe`!\r\n\r\n### Known issues \r\n\r\n* **Integration-CLI tests not executed:** Most of this test suite assumes\r\n  the daemon is running on the same machine as the client (not possible on Windows, yet)\r\n  and uses Unix sockets to verify the results. These need to be skipped, where\r\n  applicable, or these tests should be converted to use the Remote API over HTTP\r\n  instead of using Unix sockets.\r\n* **Path issues:** Due to the difference between Unix and Windows path separators,\r\n  functionality involving Dockerfile and .dockerignore (e.g. `docker build`) are not\r\n  yet working properly.\r\n* **ANSI.SYS dependency for TTY:** ANSI escape sequences used by TTY terminal code\r\n  (e.g. `docker attach`) are not natively working in the Windows Command Line (cmd.exe)\r\n  or PowerShell. The reason is, ANSI.SYS has not been shipping since Windows 7.\r\n  However, other terminal emulators like [ConEmu](https://code.google.com/p/conemu-maximus5/)\r\n  or ANSI.SYS alternatives like [ansicon](https://github.com/adoxa/ansicon)\r\n  solve this problem. We will be searching for solutions that work out-of-the box.\r\n\r\n![](http://cl.ly/image/3g0V3w352Y1D/Capture.PNG)\r\n\r\nSigned-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com> \r\nSigned-off-by: John Gossman <johngos@microsoft.com>","created_at":"2014-11-12T05:49:50Z","updated_at":"2014-11-14T16:08:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"613a1894bf2676e87113401325cdd56819722966","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/9113/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/9113/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments/{number}","comments_url":"https://api.github.com/repos/docker/docker/issues/9113/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/ca6c3a791e368a76e58932e1c181790779bd5dcc","head":{"label":"Azure:windows-client","ref":"windows-client","sha":"ca6c3a791e368a76e58932e1c181790779bd5dcc","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":26456217,"name":"docker","full_name":"Azure/docker","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/Azure/docker","forks_url":"https://api.github.com/repos/Azure/docker/forks","keys_url":"https://api.github.com/repos/Azure/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/docker/teams","hooks_url":"https://api.github.com/repos/Azure/docker/hooks","issue_events_url":"https://api.github.com/repos/Azure/docker/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/docker/events","assignees_url":"https://api.github.com/repos/Azure/docker/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/docker/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/docker/tags","blobs_url":"https://api.github.com/repos/Azure/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/docker/languages","stargazers_url":"https://api.github.com/repos/Azure/docker/stargazers","contributors_url":"https://api.github.com/repos/Azure/docker/contributors","subscribers_url":"https://api.github.com/repos/Azure/docker/subscribers","subscription_url":"https://api.github.com/repos/Azure/docker/subscription","commits_url":"https://api.github.com/repos/Azure/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/docker/issues/comments/{number}","contents_url":"https://api.github.com/repos/Azure/docker/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/docker/merges","archive_url":"https://api.github.com/repos/Azure/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/docker/downloads","issues_url":"https://api.github.com/repos/Azure/docker/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/docker/labels{/name}","releases_url":"https://api.github.com/repos/Azure/docker/releases{/id}","created_at":"2014-11-10T21:19:09Z","updated_at":"2014-11-13T14:52:30Z","pushed_at":"2014-11-13T23:43:38Z","git_url":"git://github.com/Azure/docker.git","ssh_url":"git@github.com:Azure/docker.git","clone_url":"https://github.com/Azure/docker.git","svn_url":"https://github.com/Azure/docker","homepage":"http://www.docker.com","size":36085,"stargazers_count":5,"watchers_count":5,"language":"Go","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":5,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"3aa2245914ea73f19838adbb09d0617984fbeb11","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments/{number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","created_at":"2013-01-18T18:10:57Z","updated_at":"2014-11-14T15:50:38Z","pushed_at":"2014-11-14T13:39:51Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":159394,"stargazers_count":16621,"watchers_count":16621,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3289,"mirror_url":null,"open_issues_count":924,"forks":3289,"open_issues":924,"watchers":16621,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/9113"},"html":{"href":"https://github.com/docker/docker/pull/9113"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/9113"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/9113/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/9113/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/9113/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/ca6c3a791e368a76e58932e1c181790779bd5dcc"}}}}