{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/sops/pulls/comments/86393337","pull_request_review_id":7054563,"id":86393337,"diff_hunk":"@@ -557,77 +564,115 @@ func edit(c *cli.Context, file string, fileBytes []byte) ([]byte, error) {\n \tif err != nil {\n \t\treturn nil, cli.NewExitError(fmt.Sprintf(\"Could not load file: %s\", err), exitCouldNotReadInputFile)\n \t}\n-\ttmpdir, err := ioutil.TempDir(\"\", \"\")\n-\tif err != nil {\n-\t\treturn nil, cli.NewExitError(fmt.Sprintf(\"Could not create temporary directory: %s\", err), exitCouldNotWriteOutputFile)\n-\t}\n-\tdefer os.RemoveAll(tmpdir)\n-\ttmpfile, err := os.Create(path.Join(tmpdir, path.Base(file)))\n-\tif err != nil {\n-\t\treturn nil, cli.NewExitError(fmt.Sprintf(\"Could not create temporary file: %s\", err), exitCouldNotWriteOutputFile)\n-\t}\n-\tvar out []byte\n-\tif c.Bool(\"show-master-keys\") {\n-\t\tout, err = outputStore(c, file).MarshalWithMetadata(tree.Branch, tree.Metadata)\n-\t} else {\n-\t\tout, err = outputStore(c, file).Marshal(tree.Branch)\n-\t}\n-\tif err != nil {\n-\t\treturn nil, cli.NewExitError(fmt.Sprintf(\"Could not marshal tree: %s\", err), exitErrorDumpingTree)\n-\t}\n-\t_, err = tmpfile.Write(out)\n-\tif err != nil {\n-\t\treturn nil, cli.NewExitError(fmt.Sprintf(\"Could not write output file: %s\", err), exitCouldNotWriteOutputFile)\n-\t}\n-\torigHash, err := hashFile(tmpfile.Name())\n-\tif err != nil {\n-\t\treturn nil, cli.NewExitError(fmt.Sprintf(\"Could not hash file: %s\", err), exitCouldNotReadInputFile)\n-\t}\n-\tfor {\n-\t\terr = runEditor(tmpfile.Name())\n+\tif c.String(\"set\") != \"\" {\n+\t\tpathValuePair := strings.SplitAfterN(c.String(\"set\"), \"] \", 2)","path":"cmd/sops/main.go","position":67,"original_position":67,"commit_id":"19428735fb58b986caecbf328c992d6630d48122","original_commit_id":"19428735fb58b986caecbf328c992d6630d48122","user":{"login":"jvehent","id":415617,"avatar_url":"https://avatars.githubusercontent.com/u/415617?v=3","gravatar_id":"","url":"https://api.github.com/users/jvehent","html_url":"https://github.com/jvehent","followers_url":"https://api.github.com/users/jvehent/followers","following_url":"https://api.github.com/users/jvehent/following{/other_user}","gists_url":"https://api.github.com/users/jvehent/gists{/gist_id}","starred_url":"https://api.github.com/users/jvehent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvehent/subscriptions","organizations_url":"https://api.github.com/users/jvehent/orgs","repos_url":"https://api.github.com/users/jvehent/repos","events_url":"https://api.github.com/users/jvehent/events{/privacy}","received_events_url":"https://api.github.com/users/jvehent/received_events","type":"User","site_admin":false},"body":"Need a comment that describes the algorithm we're following here, this is too convoluted to just follow the code.","created_at":"2016-11-03T17:02:59Z","updated_at":"2016-11-03T17:04:54Z","html_url":"https://github.com/mozilla/sops/pull/160#discussion_r86393337","pull_request_url":"https://api.github.com/repos/mozilla/sops/pulls/160","_links":{"self":{"href":"https://api.github.com/repos/mozilla/sops/pulls/comments/86393337"},"html":{"href":"https://github.com/mozilla/sops/pull/160#discussion_r86393337"},"pull_request":{"href":"https://api.github.com/repos/mozilla/sops/pulls/160"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/sops/pulls/160","id":92193356,"html_url":"https://github.com/mozilla/sops/pull/160","diff_url":"https://github.com/mozilla/sops/pull/160.diff","patch_url":"https://github.com/mozilla/sops/pull/160.patch","issue_url":"https://api.github.com/repos/mozilla/sops/issues/160","number":160,"state":"open","locked":false,"title":"Add --set flag","user":{"login":"autrilla","id":2260567,"avatar_url":"https://avatars.githubusercontent.com/u/2260567?v=3","gravatar_id":"","url":"https://api.github.com/users/autrilla","html_url":"https://github.com/autrilla","followers_url":"https://api.github.com/users/autrilla/followers","following_url":"https://api.github.com/users/autrilla/following{/other_user}","gists_url":"https://api.github.com/users/autrilla/gists{/gist_id}","starred_url":"https://api.github.com/users/autrilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autrilla/subscriptions","organizations_url":"https://api.github.com/users/autrilla/orgs","repos_url":"https://api.github.com/users/autrilla/repos","events_url":"https://api.github.com/users/autrilla/events{/privacy}","received_events_url":"https://api.github.com/users/autrilla/received_events","type":"User","site_admin":false},"body":"The behavior is a bit different from the Python version. Instead of `--set '[\"app2\"][\"key\"]' '\"app2keystringvalue\"'`, you have to do `--set '[\"app2\"][\"key\"] \"app2keystringvalue\"'`","created_at":"2016-11-03T16:42:50Z","updated_at":"2016-11-03T17:04:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"99b3b2343358f86fe80a063baee0f08bd6020ae2","assignee":{"login":"jvehent","id":415617,"avatar_url":"https://avatars.githubusercontent.com/u/415617?v=3","gravatar_id":"","url":"https://api.github.com/users/jvehent","html_url":"https://github.com/jvehent","followers_url":"https://api.github.com/users/jvehent/followers","following_url":"https://api.github.com/users/jvehent/following{/other_user}","gists_url":"https://api.github.com/users/jvehent/gists{/gist_id}","starred_url":"https://api.github.com/users/jvehent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvehent/subscriptions","organizations_url":"https://api.github.com/users/jvehent/orgs","repos_url":"https://api.github.com/users/jvehent/repos","events_url":"https://api.github.com/users/jvehent/events{/privacy}","received_events_url":"https://api.github.com/users/jvehent/received_events","type":"User","site_admin":false},"assignees":[{"login":"jvehent","id":415617,"avatar_url":"https://avatars.githubusercontent.com/u/415617?v=3","gravatar_id":"","url":"https://api.github.com/users/jvehent","html_url":"https://github.com/jvehent","followers_url":"https://api.github.com/users/jvehent/followers","following_url":"https://api.github.com/users/jvehent/following{/other_user}","gists_url":"https://api.github.com/users/jvehent/gists{/gist_id}","starred_url":"https://api.github.com/users/jvehent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvehent/subscriptions","organizations_url":"https://api.github.com/users/jvehent/orgs","repos_url":"https://api.github.com/users/jvehent/repos","events_url":"https://api.github.com/users/jvehent/events{/privacy}","received_events_url":"https://api.github.com/users/jvehent/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/sops/pulls/160/commits","review_comments_url":"https://api.github.com/repos/mozilla/sops/pulls/160/comments","review_comment_url":"https://api.github.com/repos/mozilla/sops/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/sops/issues/160/comments","statuses_url":"https://api.github.com/repos/mozilla/sops/statuses/19428735fb58b986caecbf328c992d6630d48122","head":{"label":"mozilla:set","ref":"set","sha":"19428735fb58b986caecbf328c992d6630d48122","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":40684033,"name":"sops","full_name":"mozilla/sops","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/sops","description":"Secrets management stinks, use some sops!","fork":false,"url":"https://api.github.com/repos/mozilla/sops","forks_url":"https://api.github.com/repos/mozilla/sops/forks","keys_url":"https://api.github.com/repos/mozilla/sops/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/sops/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/sops/teams","hooks_url":"https://api.github.com/repos/mozilla/sops/hooks","issue_events_url":"https://api.github.com/repos/mozilla/sops/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/sops/events","assignees_url":"https://api.github.com/repos/mozilla/sops/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/sops/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/sops/tags","blobs_url":"https://api.github.com/repos/mozilla/sops/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/sops/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/sops/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/sops/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/sops/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/sops/languages","stargazers_url":"https://api.github.com/repos/mozilla/sops/stargazers","contributors_url":"https://api.github.com/repos/mozilla/sops/contributors","subscribers_url":"https://api.github.com/repos/mozilla/sops/subscribers","subscription_url":"https://api.github.com/repos/mozilla/sops/subscription","commits_url":"https://api.github.com/repos/mozilla/sops/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/sops/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/sops/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/sops/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/sops/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/sops/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/sops/merges","archive_url":"https://api.github.com/repos/mozilla/sops/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/sops/downloads","issues_url":"https://api.github.com/repos/mozilla/sops/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/sops/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/sops/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/sops/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/sops/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/sops/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/sops/deployments","created_at":"2015-08-13T22:11:00Z","updated_at":"2016-11-02T17:41:21Z","pushed_at":"2016-11-03T16:46:23Z","git_url":"git://github.com/mozilla/sops.git","ssh_url":"git@github.com:mozilla/sops.git","clone_url":"https://github.com/mozilla/sops.git","svn_url":"https://github.com/mozilla/sops","homepage":"","size":4408,"stargazers_count":359,"watchers_count":359,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":11,"forks":19,"open_issues":11,"watchers":359,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"c5bf3c93bb8e8ef192869b6aba64e213dd6e6651","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":40684033,"name":"sops","full_name":"mozilla/sops","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/sops","description":"Secrets management stinks, use some sops!","fork":false,"url":"https://api.github.com/repos/mozilla/sops","forks_url":"https://api.github.com/repos/mozilla/sops/forks","keys_url":"https://api.github.com/repos/mozilla/sops/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/sops/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/sops/teams","hooks_url":"https://api.github.com/repos/mozilla/sops/hooks","issue_events_url":"https://api.github.com/repos/mozilla/sops/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/sops/events","assignees_url":"https://api.github.com/repos/mozilla/sops/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/sops/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/sops/tags","blobs_url":"https://api.github.com/repos/mozilla/sops/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/sops/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/sops/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/sops/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/sops/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/sops/languages","stargazers_url":"https://api.github.com/repos/mozilla/sops/stargazers","contributors_url":"https://api.github.com/repos/mozilla/sops/contributors","subscribers_url":"https://api.github.com/repos/mozilla/sops/subscribers","subscription_url":"https://api.github.com/repos/mozilla/sops/subscription","commits_url":"https://api.github.com/repos/mozilla/sops/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/sops/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/sops/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/sops/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/sops/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/sops/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/sops/merges","archive_url":"https://api.github.com/repos/mozilla/sops/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/sops/downloads","issues_url":"https://api.github.com/repos/mozilla/sops/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/sops/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/sops/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/sops/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/sops/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/sops/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/sops/deployments","created_at":"2015-08-13T22:11:00Z","updated_at":"2016-11-02T17:41:21Z","pushed_at":"2016-11-03T16:46:23Z","git_url":"git://github.com/mozilla/sops.git","ssh_url":"git@github.com:mozilla/sops.git","clone_url":"https://github.com/mozilla/sops.git","svn_url":"https://github.com/mozilla/sops","homepage":"","size":4408,"stargazers_count":359,"watchers_count":359,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":11,"forks":19,"open_issues":11,"watchers":359,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/sops/pulls/160"},"html":{"href":"https://github.com/mozilla/sops/pull/160"},"issue":{"href":"https://api.github.com/repos/mozilla/sops/issues/160"},"comments":{"href":"https://api.github.com/repos/mozilla/sops/issues/160/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/sops/pulls/160/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/sops/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/sops/pulls/160/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/sops/statuses/19428735fb58b986caecbf328c992d6630d48122"}}}}
{"actor":{"display_login":"jvehent"}}