{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift-package-manager/pulls/comments/70994134","id":70994134,"diff_hunk":"@@ -0,0 +1,252 @@\n+/*\n+ This source file is part of the Swift.org open source project\n+\n+ Copyright 2016 Apple Inc. and the Swift project authors\n+ Licensed under Apache License v2.0 with Runtime Library Exception\n+\n+ See http://swift.org/LICENSE.txt for license information\n+ See http://swift.org/CONTRIBUTORS.txt for Swift project authors\n+*/\n+\n+import libc\n+import func POSIX.getenv\n+\n+private protocol OutputFileStreamProtocol: OutputStream {\n+    var fd: Int32 { get }\n+    var file: UnsafeMutablePointer<FILE> { get }\n+}\n+\n+final public class OutputFileStream: OutputFileStreamProtocol {\n+    private let fd: Int32\n+    private let file: UnsafeMutablePointer<FILE>\n+\n+    init(file: UnsafeMutablePointer<FILE>) {\n+        self.file = file\n+        self.fd = fileno(file)\n+    }\n+\n+    public func write(_ string: String) {\n+        _ = fputs(string, file)\n+    }\n+}\n+\n+public var stdout = OutputFileStream(file: libc.stdout)\n+public var stderr = OutputFileStream(file: libc.stderr)\n+\n+/// Terminal color choices.\n+public enum TermColor {\n+    case noColor\n+\n+    case red\n+    case green\n+    case yellow\n+\n+    case white\n+    case black\n+    case grey\n+\n+    /// Returns the color code which can be prefixed on a string to display it in that color.\n+    /// Note: To avoid unexpected behavior the color codes are private and not exposed to clients\n+    /// other than TerminalController.\n+    private var string: String {\n+        switch self {\n+        case .noColor: return \"\"\n+        case .red: return \"\\u{001B}[31m\"\n+        case .green: return \"\\u{001B}[32m\"\n+        case .yellow: return \"\\u{001B}[33m\"\n+        case .white: return \"\\u{001B}[37m\"\n+        case .black: return \"\\u{001B}[30m\"\n+        case .grey: return \"\\u{001B}[30;1m\"\n+        }\n+    }\n+}\n+\n+/// Number of the columns in the current terminal.\n+// FIXME: What if user resizes terminal during execution?\n+public var terminalWidth: Int = {\n+    // Try to get from enviornment.\n+    if let columns = POSIX.getenv(\"COLUMNS\"), let width = Int(columns) {\n+        return width\n+    }\n+\n+    // Try determining using ioctl.\n+    var ws = winsize()\n+    if ioctl(1, UInt(TIOCGWINSZ), &ws) == 0 {\n+        return Int(ws.ws_col)\n+    }\n+\n+    // If we can't determine, just assume a default.\n+    return 80\n+}()\n+\n+/// A class to have better control on output streams especially standard output and standard error streams.\n+/// Allows operations like cursor movement and colored text output if allowed by the tty.\n+public final class TerminalController<Target: OutputStream> {\n+\n+    /// A \"dumb\" terminal indicates that it has no capabailities for eg: update current line, colors\n+    /// The output stream is probably a file or similar.\n+    public let dumb: Bool\n+\n+    /// Pointer to output stream to operate on.\n+    private var stream: UnsafeMutablePointer<Target>\n+\n+    public init(stream: UnsafeMutablePointer<Target>) {\n+        if case let stdStream as OutputFileStreamProtocol = stream.pointee {\n+            dumb = !(isatty(stdStream.fd) == 0)\n+        } else {\n+            dumb = true\n+        }\n+\n+        self.stream = stream\n+    }\n+\n+    /// Code to clear the line on a tty.\n+    private let clearLineString = \"\\u{001B}[2K\"\n+\n+    /// Code to end any currently active wrapping.\n+    private let resetString = \"\\u{001B}[0m\"\n+\n+    /// Clears the current line and moves the cursor to beginning of the line..\n+    public func clearline() {\n+        guard !dumb else { return }\n+        print(clearLineString + \"\\r\", terminator: \"\", to: &stream.pointee)\n+    }\n+\n+    /// Moves the cursor y columns up.\n+    public func moveCursor(y: Int) {\n+        guard !dumb else { return }\n+        print(\"\\u{001B}[\\(y)A\", terminator: \"\", to: &stream.pointee)\n+    }\n+\n+    /// Writes a line to the output stream. Truncates the line in middle if line is longer than the terminal width.\n+    /// If not writing to a terminal entire line will be written without truncation.\n+    public func writeLine(line: String, color: TermColor = .noColor) {\n+        let wrappedLine = wrap(line, inColor: color)\n+        print(truncate(wrappedLine), terminator: \"\", to: &stream.pointee)\n+        flush()\n+    }\n+\n+    /// Writes a string to the stream.\n+    public func write(string: String, color: TermColor = .noColor) {\n+        print(wrap(string, inColor: color), terminator: \"\", to: &stream.pointee)\n+        flush()\n+    }\n+\n+    /// Inserts a new line character into the stream.\n+    public func endLine() {\n+        print(\"\\n\", terminator: \"\", to: &stream.pointee)\n+        flush()\n+    }\n+\n+    /// Flushes the stream if writing to a filestream.\n+    public func flush() {\n+        if case let stdStream as OutputFileStreamProtocol = stream.pointee {\n+            fflush(stdStream.file)\n+        }\n+    }\n+\n+    /// Truncates the given line in middle to fit the terminal width if writing to tty\n+    /// otherwise returns the same string.\n+    private func truncate(_ line: String) -> String {\n+        // Return the original line if we don't need to truncate.\n+        guard !dumb && line.utf8.count > terminalWidth else {\n+            return line\n+        }\n+        let mid = terminalWidth/2\n+        let frontIndex = line.index(line.startIndex, offsetBy: max(0, mid - 2))\n+        let backIndex = line.index(line.endIndex, offsetBy: -(mid + 1))\n+        return line[line.startIndex..<frontIndex] + \"...\" + line[backIndex..<line.endIndex]\n+    }\n+\n+    /// Wraps the string into the color mentioned. If terminal is dumb no color code will be inserted.\n+    private func wrap(_ line: String, inColor color: TermColor) -> String {\n+        guard !dumb || !line.isEmpty || color == .noColor else {\n+            return line\n+        }\n+        return color.string + line + resetString\n+    }\n+}\n+\n+// FIXME: Move progessbar to utility?","path":"Sources/Basic/TerminalController.swift","position":170,"original_position":170,"commit_id":"41d8845a11820c6f699213265fdf89f5df68acd5","original_commit_id":"41d8845a11820c6f699213265fdf89f5df68acd5","user":{"login":"ddunbar","id":106625,"avatar_url":"https://avatars.githubusercontent.com/u/106625?v=3","gravatar_id":"","url":"https://api.github.com/users/ddunbar","html_url":"https://github.com/ddunbar","followers_url":"https://api.github.com/users/ddunbar/followers","following_url":"https://api.github.com/users/ddunbar/following{/other_user}","gists_url":"https://api.github.com/users/ddunbar/gists{/gist_id}","starred_url":"https://api.github.com/users/ddunbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddunbar/subscriptions","organizations_url":"https://api.github.com/users/ddunbar/orgs","repos_url":"https://api.github.com/users/ddunbar/repos","events_url":"https://api.github.com/users/ddunbar/events{/privacy}","received_events_url":"https://api.github.com/users/ddunbar/received_events","type":"User","site_admin":false},"body":"Yeah, I'm not sure where it should live.\r\n\r\nIt's not domain-specific, and it \"could\" be in a rich standard library, which are my two predicates for deciding if something makes sense in Basic, so I am OK leaving it here. The less policy it encodes the better, though.","created_at":"2016-07-15T15:42:05Z","updated_at":"2016-07-15T15:42:05Z","html_url":"https://github.com/apple/swift-package-manager/pull/502#discussion_r70994134","pull_request_url":"https://api.github.com/repos/apple/swift-package-manager/pulls/502","_links":{"self":{"href":"https://api.github.com/repos/apple/swift-package-manager/pulls/comments/70994134"},"html":{"href":"https://github.com/apple/swift-package-manager/pull/502#discussion_r70994134"},"pull_request":{"href":"https://api.github.com/repos/apple/swift-package-manager/pulls/502"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift-package-manager/pulls/502","id":77627629,"html_url":"https://github.com/apple/swift-package-manager/pull/502","diff_url":"https://github.com/apple/swift-package-manager/pull/502.diff","patch_url":"https://github.com/apple/swift-package-manager/pull/502.patch","issue_url":"https://api.github.com/repos/apple/swift-package-manager/issues/502","number":502,"state":"open","locked":false,"title":"[WIP][Basic] Add TerminalController class","user":{"login":"aciidb0mb3r","id":4136295,"avatar_url":"https://avatars.githubusercontent.com/u/4136295?v=3","gravatar_id":"","url":"https://api.github.com/users/aciidb0mb3r","html_url":"https://github.com/aciidb0mb3r","followers_url":"https://api.github.com/users/aciidb0mb3r/followers","following_url":"https://api.github.com/users/aciidb0mb3r/following{/other_user}","gists_url":"https://api.github.com/users/aciidb0mb3r/gists{/gist_id}","starred_url":"https://api.github.com/users/aciidb0mb3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aciidb0mb3r/subscriptions","organizations_url":"https://api.github.com/users/aciidb0mb3r/orgs","repos_url":"https://api.github.com/users/aciidb0mb3r/repos","events_url":"https://api.github.com/users/aciidb0mb3r/events{/privacy}","received_events_url":"https://api.github.com/users/aciidb0mb3r/received_events","type":"User","site_admin":false},"body":"I was able to implement a lit-style progress bar without using curses (yay!). Currently how it works is `TerminalController` takes any object conforming to `OutputStream` and exposes APIs to perform operations like write with colour and cursor movement on it. If the output stream is not a tty then TerminalController will ignore the tty operations and write in plain text. This PR is not fully complete yet, needs tests and some calculation fixing but works. I want to get feedback for the APIs and direction.\r\n","created_at":"2016-07-15T14:49:17Z","updated_at":"2016-07-15T15:42:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9270e2d4bc1697c062d98918a9ec54ed98fd2ab","assignee":{"login":"ddunbar","id":106625,"avatar_url":"https://avatars.githubusercontent.com/u/106625?v=3","gravatar_id":"","url":"https://api.github.com/users/ddunbar","html_url":"https://github.com/ddunbar","followers_url":"https://api.github.com/users/ddunbar/followers","following_url":"https://api.github.com/users/ddunbar/following{/other_user}","gists_url":"https://api.github.com/users/ddunbar/gists{/gist_id}","starred_url":"https://api.github.com/users/ddunbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddunbar/subscriptions","organizations_url":"https://api.github.com/users/ddunbar/orgs","repos_url":"https://api.github.com/users/ddunbar/repos","events_url":"https://api.github.com/users/ddunbar/events{/privacy}","received_events_url":"https://api.github.com/users/ddunbar/received_events","type":"User","site_admin":false},"assignees":[{"login":"ddunbar","id":106625,"avatar_url":"https://avatars.githubusercontent.com/u/106625?v=3","gravatar_id":"","url":"https://api.github.com/users/ddunbar","html_url":"https://github.com/ddunbar","followers_url":"https://api.github.com/users/ddunbar/followers","following_url":"https://api.github.com/users/ddunbar/following{/other_user}","gists_url":"https://api.github.com/users/ddunbar/gists{/gist_id}","starred_url":"https://api.github.com/users/ddunbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddunbar/subscriptions","organizations_url":"https://api.github.com/users/ddunbar/orgs","repos_url":"https://api.github.com/users/ddunbar/repos","events_url":"https://api.github.com/users/ddunbar/events{/privacy}","received_events_url":"https://api.github.com/users/ddunbar/received_events","type":"User","site_admin":false},{"login":"abertelrud","id":18221004,"avatar_url":"https://avatars.githubusercontent.com/u/18221004?v=3","gravatar_id":"","url":"https://api.github.com/users/abertelrud","html_url":"https://github.com/abertelrud","followers_url":"https://api.github.com/users/abertelrud/followers","following_url":"https://api.github.com/users/abertelrud/following{/other_user}","gists_url":"https://api.github.com/users/abertelrud/gists{/gist_id}","starred_url":"https://api.github.com/users/abertelrud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abertelrud/subscriptions","organizations_url":"https://api.github.com/users/abertelrud/orgs","repos_url":"https://api.github.com/users/abertelrud/repos","events_url":"https://api.github.com/users/abertelrud/events{/privacy}","received_events_url":"https://api.github.com/users/abertelrud/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift-package-manager/pulls/502/commits","review_comments_url":"https://api.github.com/repos/apple/swift-package-manager/pulls/502/comments","review_comment_url":"https://api.github.com/repos/apple/swift-package-manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift-package-manager/issues/502/comments","statuses_url":"https://api.github.com/repos/apple/swift-package-manager/statuses/41d8845a11820c6f699213265fdf89f5df68acd5","head":{"label":"aciidb0mb3r:term-controller","ref":"term-controller","sha":"41d8845a11820c6f699213265fdf89f5df68acd5","user":{"login":"aciidb0mb3r","id":4136295,"avatar_url":"https://avatars.githubusercontent.com/u/4136295?v=3","gravatar_id":"","url":"https://api.github.com/users/aciidb0mb3r","html_url":"https://github.com/aciidb0mb3r","followers_url":"https://api.github.com/users/aciidb0mb3r/followers","following_url":"https://api.github.com/users/aciidb0mb3r/following{/other_user}","gists_url":"https://api.github.com/users/aciidb0mb3r/gists{/gist_id}","starred_url":"https://api.github.com/users/aciidb0mb3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aciidb0mb3r/subscriptions","organizations_url":"https://api.github.com/users/aciidb0mb3r/orgs","repos_url":"https://api.github.com/users/aciidb0mb3r/repos","events_url":"https://api.github.com/users/aciidb0mb3r/events{/privacy}","received_events_url":"https://api.github.com/users/aciidb0mb3r/received_events","type":"User","site_admin":false},"repo":{"id":47417816,"name":"swift-package-manager","full_name":"aciidb0mb3r/swift-package-manager","owner":{"login":"aciidb0mb3r","id":4136295,"avatar_url":"https://avatars.githubusercontent.com/u/4136295?v=3","gravatar_id":"","url":"https://api.github.com/users/aciidb0mb3r","html_url":"https://github.com/aciidb0mb3r","followers_url":"https://api.github.com/users/aciidb0mb3r/followers","following_url":"https://api.github.com/users/aciidb0mb3r/following{/other_user}","gists_url":"https://api.github.com/users/aciidb0mb3r/gists{/gist_id}","starred_url":"https://api.github.com/users/aciidb0mb3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aciidb0mb3r/subscriptions","organizations_url":"https://api.github.com/users/aciidb0mb3r/orgs","repos_url":"https://api.github.com/users/aciidb0mb3r/repos","events_url":"https://api.github.com/users/aciidb0mb3r/events{/privacy}","received_events_url":"https://api.github.com/users/aciidb0mb3r/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aciidb0mb3r/swift-package-manager","description":"The Package Manager for the Swift Programming Language","fork":true,"url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager","forks_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/forks","keys_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/teams","hooks_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/hooks","issue_events_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/issues/events{/number}","events_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/events","assignees_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/assignees{/user}","branches_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/branches{/branch}","tags_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/tags","blobs_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/languages","stargazers_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/stargazers","contributors_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/contributors","subscribers_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/subscribers","subscription_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/subscription","commits_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/contents/{+path}","compare_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/merges","archive_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/downloads","issues_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/issues{/number}","pulls_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/labels{/name}","releases_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/releases{/id}","deployments_url":"https://api.github.com/repos/aciidb0mb3r/swift-package-manager/deployments","created_at":"2015-12-04T17:05:51Z","updated_at":"2016-02-04T13:02:44Z","pushed_at":"2016-07-15T14:44:26Z","git_url":"git://github.com/aciidb0mb3r/swift-package-manager.git","ssh_url":"git@github.com:aciidb0mb3r/swift-package-manager.git","clone_url":"https://github.com/aciidb0mb3r/swift-package-manager.git","svn_url":"https://github.com/aciidb0mb3r/swift-package-manager","homepage":"","size":2323,"stargazers_count":0,"watchers_count":0,"language":"Swift","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":"master"}},"base":{"label":"apple:master","ref":"master","sha":"b24c72c065476a25846f30a0357981bfae84262d","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":44840041,"name":"swift-package-manager","full_name":"apple/swift-package-manager","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift-package-manager","description":"The Package Manager for the Swift Programming Language","fork":false,"url":"https://api.github.com/repos/apple/swift-package-manager","forks_url":"https://api.github.com/repos/apple/swift-package-manager/forks","keys_url":"https://api.github.com/repos/apple/swift-package-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift-package-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift-package-manager/teams","hooks_url":"https://api.github.com/repos/apple/swift-package-manager/hooks","issue_events_url":"https://api.github.com/repos/apple/swift-package-manager/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift-package-manager/events","assignees_url":"https://api.github.com/repos/apple/swift-package-manager/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift-package-manager/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift-package-manager/tags","blobs_url":"https://api.github.com/repos/apple/swift-package-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift-package-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift-package-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift-package-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift-package-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift-package-manager/languages","stargazers_url":"https://api.github.com/repos/apple/swift-package-manager/stargazers","contributors_url":"https://api.github.com/repos/apple/swift-package-manager/contributors","subscribers_url":"https://api.github.com/repos/apple/swift-package-manager/subscribers","subscription_url":"https://api.github.com/repos/apple/swift-package-manager/subscription","commits_url":"https://api.github.com/repos/apple/swift-package-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift-package-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift-package-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift-package-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift-package-manager/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift-package-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift-package-manager/merges","archive_url":"https://api.github.com/repos/apple/swift-package-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift-package-manager/downloads","issues_url":"https://api.github.com/repos/apple/swift-package-manager/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift-package-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift-package-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift-package-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift-package-manager/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift-package-manager/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift-package-manager/deployments","created_at":"2015-10-23T21:41:12Z","updated_at":"2016-07-15T10:54:34Z","pushed_at":"2016-07-15T14:49:17Z","git_url":"git://github.com/apple/swift-package-manager.git","ssh_url":"git@github.com:apple/swift-package-manager.git","clone_url":"https://github.com/apple/swift-package-manager.git","svn_url":"https://github.com/apple/swift-package-manager","homepage":"","size":3158,"stargazers_count":4368,"watchers_count":4368,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":385,"mirror_url":null,"open_issues_count":10,"forks":385,"open_issues":10,"watchers":4368,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift-package-manager/pulls/502"},"html":{"href":"https://github.com/apple/swift-package-manager/pull/502"},"issue":{"href":"https://api.github.com/repos/apple/swift-package-manager/issues/502"},"comments":{"href":"https://api.github.com/repos/apple/swift-package-manager/issues/502/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift-package-manager/pulls/502/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift-package-manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift-package-manager/pulls/502/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift-package-manager/statuses/41d8845a11820c6f699213265fdf89f5df68acd5"}}}}
{"actor":{"display_login":"ddunbar"}}