{"action":"created","comment":{"url":"https://api.github.com/repos/flatpak/flatpak-builder/pulls/comments/198137743","pull_request_review_id":132012078,"id":198137743,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODEzNzc0Mw==","diff_hunk":"@@ -186,6 +186,46 @@ builder_source_patch_download (BuilderSource  *source,\n   return TRUE;\n }\n \n+static gboolean\n+git (GFile   *dir,\n+     ...)\n+{\n+  gboolean res;\n+  va_list ap;\n+\n+  va_start (ap, dir);\n+  res = flatpak_spawn (dir, NULL, 0, NULL, \"git\", ap);\n+  va_end (ap);\n+\n+  return res;\n+}\n+\n+static gboolean\n+ensure_git (GFile *dir)\n+{\n+  GFile *git_dir;\n+  gboolean ret;\n+  char *basename;\n+\n+  git_dir = g_file_get_child (dir, \".git\");\n+  ret = g_file_query_exists (git_dir, NULL);\n+  g_object_unref (git_dir);","path":"src/builder-source-patch.c","position":27,"original_position":27,"commit_id":"87691fc0a673273801a6646cd702f7b537e2880e","original_commit_id":"97cb302c35f8978af74a9e74bef1c7363566f720","user":{"login":"alexlarsson","id":990736,"node_id":"MDQ6VXNlcjk5MDczNg==","avatar_url":"https://avatars2.githubusercontent.com/u/990736?v=4","gravatar_id":"","url":"https://api.github.com/users/alexlarsson","html_url":"https://github.com/alexlarsson","followers_url":"https://api.github.com/users/alexlarsson/followers","following_url":"https://api.github.com/users/alexlarsson/following{/other_user}","gists_url":"https://api.github.com/users/alexlarsson/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlarsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlarsson/subscriptions","organizations_url":"https://api.github.com/users/alexlarsson/orgs","repos_url":"https://api.github.com/users/alexlarsson/repos","events_url":"https://api.github.com/users/alexlarsson/events{/privacy}","received_events_url":"https://api.github.com/users/alexlarsson/received_events","type":"User","site_admin":false},"body":"Say the toplevel is a git checkout and you want to apply a patch to a subdirectory only (dest=subdir in the source), then it will look for subdir/.git which doesn't exist, rather than the toplevel .git which does, and then wrongly do git init.","created_at":"2018-06-26T13:15:31Z","updated_at":"2018-06-26T13:15:31Z","html_url":"https://github.com/flatpak/flatpak-builder/pull/174#discussion_r198137743","pull_request_url":"https://api.github.com/repos/flatpak/flatpak-builder/pulls/174","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/flatpak/flatpak-builder/pulls/comments/198137743"},"html":{"href":"https://github.com/flatpak/flatpak-builder/pull/174#discussion_r198137743"},"pull_request":{"href":"https://api.github.com/repos/flatpak/flatpak-builder/pulls/174"}},"in_reply_to_id":198112970},"pull_request":{"url":"https://api.github.com/repos/flatpak/flatpak-builder/pulls/174","id":197382939,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3MzgyOTM5","html_url":"https://github.com/flatpak/flatpak-builder/pull/174","diff_url":"https://github.com/flatpak/flatpak-builder/pull/174.diff","patch_url":"https://github.com/flatpak/flatpak-builder/pull/174.patch","issue_url":"https://api.github.com/repos/flatpak/flatpak-builder/issues/174","number":174,"state":"open","locked":false,"title":"builder: Initialise git tree when using \"use-git\" for patches","user":{"login":"hadess","id":769861,"node_id":"MDQ6VXNlcjc2OTg2MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/769861?v=4","gravatar_id":"","url":"https://api.github.com/users/hadess","html_url":"https://github.com/hadess","followers_url":"https://api.github.com/users/hadess/followers","following_url":"https://api.github.com/users/hadess/following{/other_user}","gists_url":"https://api.github.com/users/hadess/gists{/gist_id}","starred_url":"https://api.github.com/users/hadess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadess/subscriptions","organizations_url":"https://api.github.com/users/hadess/orgs","repos_url":"https://api.github.com/users/hadess/repos","events_url":"https://api.github.com/users/hadess/events{/privacy}","received_events_url":"https://api.github.com/users/hadess/received_events","type":"User","site_admin":false},"body":"When applying patches using git, git apply will ignore non-existent\r\npatches that apply to non-existent files. As the vanilla source we use\r\nto apply those patches might not be a git tree (eg. a tarball), make\r\nsure that the tree is initialised before apply those git patches.\r\n\r\nFixes \"Skipped patch ...\" messages appearing in builds.","created_at":"2018-06-26T11:00:24Z","updated_at":"2018-06-26T13:15:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc56c1608803b1971e60dd36c2fae1bb7f454f2c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/flatpak/flatpak-builder/pulls/174/commits","review_comments_url":"https://api.github.com/repos/flatpak/flatpak-builder/pulls/174/comments","review_comment_url":"https://api.github.com/repos/flatpak/flatpak-builder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flatpak/flatpak-builder/issues/174/comments","statuses_url":"https://api.github.com/repos/flatpak/flatpak-builder/statuses/87691fc0a673273801a6646cd702f7b537e2880e","head":{"label":"flatpak:wip/hadess/git-init","ref":"wip/hadess/git-init","sha":"87691fc0a673273801a6646cd702f7b537e2880e","user":{"login":"flatpak","id":19473042,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDczMDQy","avatar_url":"https://avatars0.githubusercontent.com/u/19473042?v=4","gravatar_id":"","url":"https://api.github.com/users/flatpak","html_url":"https://github.com/flatpak","followers_url":"https://api.github.com/users/flatpak/followers","following_url":"https://api.github.com/users/flatpak/following{/other_user}","gists_url":"https://api.github.com/users/flatpak/gists{/gist_id}","starred_url":"https://api.github.com/users/flatpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flatpak/subscriptions","organizations_url":"https://api.github.com/users/flatpak/orgs","repos_url":"https://api.github.com/users/flatpak/repos","events_url":"https://api.github.com/users/flatpak/events{/privacy}","received_events_url":"https://api.github.com/users/flatpak/received_events","type":"Organization","site_admin":false},"repo":{"id":101387884,"node_id":"MDEwOlJlcG9zaXRvcnkxMDEzODc4ODQ=","name":"flatpak-builder","full_name":"flatpak/flatpak-builder","owner":{"login":"flatpak","id":19473042,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDczMDQy","avatar_url":"https://avatars0.githubusercontent.com/u/19473042?v=4","gravatar_id":"","url":"https://api.github.com/users/flatpak","html_url":"https://github.com/flatpak","followers_url":"https://api.github.com/users/flatpak/followers","following_url":"https://api.github.com/users/flatpak/following{/other_user}","gists_url":"https://api.github.com/users/flatpak/gists{/gist_id}","starred_url":"https://api.github.com/users/flatpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flatpak/subscriptions","organizations_url":"https://api.github.com/users/flatpak/orgs","repos_url":"https://api.github.com/users/flatpak/repos","events_url":"https://api.github.com/users/flatpak/events{/privacy}","received_events_url":"https://api.github.com/users/flatpak/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flatpak/flatpak-builder","description":"Tool to build flatpaks from source","fork":false,"url":"https://api.github.com/repos/flatpak/flatpak-builder","forks_url":"https://api.github.com/repos/flatpak/flatpak-builder/forks","keys_url":"https://api.github.com/repos/flatpak/flatpak-builder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flatpak/flatpak-builder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flatpak/flatpak-builder/teams","hooks_url":"https://api.github.com/repos/flatpak/flatpak-builder/hooks","issue_events_url":"https://api.github.com/repos/flatpak/flatpak-builder/issues/events{/number}","events_url":"https://api.github.com/repos/flatpak/flatpak-builder/events","assignees_url":"https://api.github.com/repos/flatpak/flatpak-builder/assignees{/user}","branches_url":"https://api.github.com/repos/flatpak/flatpak-builder/branches{/branch}","tags_url":"https://api.github.com/repos/flatpak/flatpak-builder/tags","blobs_url":"https://api.github.com/repos/flatpak/flatpak-builder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flatpak/flatpak-builder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flatpak/flatpak-builder/git/refs{/sha}","trees_url":"https://api.github.com/repos/flatpak/flatpak-builder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flatpak/flatpak-builder/statuses/{sha}","languages_url":"https://api.github.com/repos/flatpak/flatpak-builder/languages","stargazers_url":"https://api.github.com/repos/flatpak/flatpak-builder/stargazers","contributors_url":"https://api.github.com/repos/flatpak/flatpak-builder/contributors","subscribers_url":"https://api.github.com/repos/flatpak/flatpak-builder/subscribers","subscription_url":"https://api.github.com/repos/flatpak/flatpak-builder/subscription","commits_url":"https://api.github.com/repos/flatpak/flatpak-builder/commits{/sha}","git_commits_url":"https://api.github.com/repos/flatpak/flatpak-builder/git/commits{/sha}","comments_url":"https://api.github.com/repos/flatpak/flatpak-builder/comments{/number}","issue_comment_url":"https://api.github.com/repos/flatpak/flatpak-builder/issues/comments{/number}","contents_url":"https://api.github.com/repos/flatpak/flatpak-builder/contents/{+path}","compare_url":"https://api.github.com/repos/flatpak/flatpak-builder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flatpak/flatpak-builder/merges","archive_url":"https://api.github.com/repos/flatpak/flatpak-builder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flatpak/flatpak-builder/downloads","issues_url":"https://api.github.com/repos/flatpak/flatpak-builder/issues{/number}","pulls_url":"https://api.github.com/repos/flatpak/flatpak-builder/pulls{/number}","milestones_url":"https://api.github.com/repos/flatpak/flatpak-builder/milestones{/number}","notifications_url":"https://api.github.com/repos/flatpak/flatpak-builder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flatpak/flatpak-builder/labels{/name}","releases_url":"https://api.github.com/repos/flatpak/flatpak-builder/releases{/id}","deployments_url":"https://api.github.com/repos/flatpak/flatpak-builder/deployments","created_at":"2017-08-25T09:18:35Z","updated_at":"2018-06-26T11:08:50Z","pushed_at":"2018-06-26T12:19:23Z","git_url":"git://github.com/flatpak/flatpak-builder.git","ssh_url":"git@github.com:flatpak/flatpak-builder.git","clone_url":"https://github.com/flatpak/flatpak-builder.git","svn_url":"https://github.com/flatpak/flatpak-builder","homepage":null,"size":7753,"stargazers_count":22,"watchers_count":22,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":62,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":20,"open_issues":62,"watchers":22,"default_branch":"master"}},"base":{"label":"flatpak:master","ref":"master","sha":"823c7604132f15ebefab9de101573dd54ce5d094","user":{"login":"flatpak","id":19473042,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDczMDQy","avatar_url":"https://avatars0.githubusercontent.com/u/19473042?v=4","gravatar_id":"","url":"https://api.github.com/users/flatpak","html_url":"https://github.com/flatpak","followers_url":"https://api.github.com/users/flatpak/followers","following_url":"https://api.github.com/users/flatpak/following{/other_user}","gists_url":"https://api.github.com/users/flatpak/gists{/gist_id}","starred_url":"https://api.github.com/users/flatpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flatpak/subscriptions","organizations_url":"https://api.github.com/users/flatpak/orgs","repos_url":"https://api.github.com/users/flatpak/repos","events_url":"https://api.github.com/users/flatpak/events{/privacy}","received_events_url":"https://api.github.com/users/flatpak/received_events","type":"Organization","site_admin":false},"repo":{"id":101387884,"node_id":"MDEwOlJlcG9zaXRvcnkxMDEzODc4ODQ=","name":"flatpak-builder","full_name":"flatpak/flatpak-builder","owner":{"login":"flatpak","id":19473042,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDczMDQy","avatar_url":"https://avatars0.githubusercontent.com/u/19473042?v=4","gravatar_id":"","url":"https://api.github.com/users/flatpak","html_url":"https://github.com/flatpak","followers_url":"https://api.github.com/users/flatpak/followers","following_url":"https://api.github.com/users/flatpak/following{/other_user}","gists_url":"https://api.github.com/users/flatpak/gists{/gist_id}","starred_url":"https://api.github.com/users/flatpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flatpak/subscriptions","organizations_url":"https://api.github.com/users/flatpak/orgs","repos_url":"https://api.github.com/users/flatpak/repos","events_url":"https://api.github.com/users/flatpak/events{/privacy}","received_events_url":"https://api.github.com/users/flatpak/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flatpak/flatpak-builder","description":"Tool to build flatpaks from source","fork":false,"url":"https://api.github.com/repos/flatpak/flatpak-builder","forks_url":"https://api.github.com/repos/flatpak/flatpak-builder/forks","keys_url":"https://api.github.com/repos/flatpak/flatpak-builder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flatpak/flatpak-builder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flatpak/flatpak-builder/teams","hooks_url":"https://api.github.com/repos/flatpak/flatpak-builder/hooks","issue_events_url":"https://api.github.com/repos/flatpak/flatpak-builder/issues/events{/number}","events_url":"https://api.github.com/repos/flatpak/flatpak-builder/events","assignees_url":"https://api.github.com/repos/flatpak/flatpak-builder/assignees{/user}","branches_url":"https://api.github.com/repos/flatpak/flatpak-builder/branches{/branch}","tags_url":"https://api.github.com/repos/flatpak/flatpak-builder/tags","blobs_url":"https://api.github.com/repos/flatpak/flatpak-builder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flatpak/flatpak-builder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flatpak/flatpak-builder/git/refs{/sha}","trees_url":"https://api.github.com/repos/flatpak/flatpak-builder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flatpak/flatpak-builder/statuses/{sha}","languages_url":"https://api.github.com/repos/flatpak/flatpak-builder/languages","stargazers_url":"https://api.github.com/repos/flatpak/flatpak-builder/stargazers","contributors_url":"https://api.github.com/repos/flatpak/flatpak-builder/contributors","subscribers_url":"https://api.github.com/repos/flatpak/flatpak-builder/subscribers","subscription_url":"https://api.github.com/repos/flatpak/flatpak-builder/subscription","commits_url":"https://api.github.com/repos/flatpak/flatpak-builder/commits{/sha}","git_commits_url":"https://api.github.com/repos/flatpak/flatpak-builder/git/commits{/sha}","comments_url":"https://api.github.com/repos/flatpak/flatpak-builder/comments{/number}","issue_comment_url":"https://api.github.com/repos/flatpak/flatpak-builder/issues/comments{/number}","contents_url":"https://api.github.com/repos/flatpak/flatpak-builder/contents/{+path}","compare_url":"https://api.github.com/repos/flatpak/flatpak-builder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flatpak/flatpak-builder/merges","archive_url":"https://api.github.com/repos/flatpak/flatpak-builder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flatpak/flatpak-builder/downloads","issues_url":"https://api.github.com/repos/flatpak/flatpak-builder/issues{/number}","pulls_url":"https://api.github.com/repos/flatpak/flatpak-builder/pulls{/number}","milestones_url":"https://api.github.com/repos/flatpak/flatpak-builder/milestones{/number}","notifications_url":"https://api.github.com/repos/flatpak/flatpak-builder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flatpak/flatpak-builder/labels{/name}","releases_url":"https://api.github.com/repos/flatpak/flatpak-builder/releases{/id}","deployments_url":"https://api.github.com/repos/flatpak/flatpak-builder/deployments","created_at":"2017-08-25T09:18:35Z","updated_at":"2018-06-26T11:08:50Z","pushed_at":"2018-06-26T12:19:23Z","git_url":"git://github.com/flatpak/flatpak-builder.git","ssh_url":"git@github.com:flatpak/flatpak-builder.git","clone_url":"https://github.com/flatpak/flatpak-builder.git","svn_url":"https://github.com/flatpak/flatpak-builder","homepage":null,"size":7753,"stargazers_count":22,"watchers_count":22,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":62,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":20,"open_issues":62,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flatpak/flatpak-builder/pulls/174"},"html":{"href":"https://github.com/flatpak/flatpak-builder/pull/174"},"issue":{"href":"https://api.github.com/repos/flatpak/flatpak-builder/issues/174"},"comments":{"href":"https://api.github.com/repos/flatpak/flatpak-builder/issues/174/comments"},"review_comments":{"href":"https://api.github.com/repos/flatpak/flatpak-builder/pulls/174/comments"},"review_comment":{"href":"https://api.github.com/repos/flatpak/flatpak-builder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flatpak/flatpak-builder/pulls/174/commits"},"statuses":{"href":"https://api.github.com/repos/flatpak/flatpak-builder/statuses/87691fc0a673273801a6646cd702f7b537e2880e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alexlarsson"}}