{"action":"created","comment":{"url":"https://api.github.com/repos/coreos/rkt/pulls/comments/60031292","id":60031292,"diff_hunk":"@@ -28,14 +28,23 @@ function ciSkip {\n     exit 0\n }\n \n+# Finds the branching point of two commits. \n+# For example, let B and D be two commits, and their ancestry graph as A -> B, A -> C -> D. \n+# Given commits B and D, it returns A. \n+function getLowestCommonAncestorCommitHash {\n+    diff --old-line-format='' --new-line-format='' \\\n+        <(git rev-list --first-parent \"${1:-$1}\") \\\n+            <(git rev-list --first-parent \"${2:-$2}\") | head-1\n+}\n+\n # Configure SemaphoreCI environment.\n function semaphoreConfiguration {\n     # We might not need to run functional tests or process docs.\n     # This is best-effort; || true ensures this does not affect test outcome\n     # First, ensure origin is updated - semaphore can do some weird caching\n     git fetch || true\n-    SRC_CHANGES=$(git diff-tree --no-commit-id --name-only -r HEAD..origin/master | grep -cEv ${DOC_CHANGE_PATTERN}) || true\n-    DOC_CHANGES=$(git diff-tree --no-commit-id --name-only -r HEAD..origin/master | grep -cE ${DOC_CHANGE_PATTERN}) || true\n+    SRC_CHANGES=$(getLowestCommonAncestorCommitHash HEAD origin/master | grep -cEv ${DOC_CHANGE_PATTERN}) || true","path":"tests/build-and-run-tests.sh","position":21,"original_position":21,"commit_id":"8bdd5cc836bcb50c3d7503ef11c98e264b58422c","original_commit_id":"8bdd5cc836bcb50c3d7503ef11c98e264b58422c","user":{"login":"iaguis","id":507354,"avatar_url":"https://avatars.githubusercontent.com/u/507354?v=3","gravatar_id":"","url":"https://api.github.com/users/iaguis","html_url":"https://github.com/iaguis","followers_url":"https://api.github.com/users/iaguis/followers","following_url":"https://api.github.com/users/iaguis/following{/other_user}","gists_url":"https://api.github.com/users/iaguis/gists{/gist_id}","starred_url":"https://api.github.com/users/iaguis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iaguis/subscriptions","organizations_url":"https://api.github.com/users/iaguis/orgs","repos_url":"https://api.github.com/users/iaguis/repos","events_url":"https://api.github.com/users/iaguis/events{/privacy}","received_events_url":"https://api.github.com/users/iaguis/received_events","type":"User","site_admin":false},"body":"So `getLowestCommonAncestorCommitHash` returns the commit hash of the ancestor. However, we want to get the changes between HEAD and that commit to know which files changed.","created_at":"2016-04-18T09:45:29Z","updated_at":"2016-04-18T09:45:29Z","html_url":"https://github.com/coreos/rkt/pull/2447#discussion_r60031292","pull_request_url":"https://api.github.com/repos/coreos/rkt/pulls/2447","_links":{"self":{"href":"https://api.github.com/repos/coreos/rkt/pulls/comments/60031292"},"html":{"href":"https://github.com/coreos/rkt/pull/2447#discussion_r60031292"},"pull_request":{"href":"https://api.github.com/repos/coreos/rkt/pulls/2447"}}},"pull_request":{"url":"https://api.github.com/repos/coreos/rkt/pulls/2447","id":66818558,"html_url":"https://github.com/coreos/rkt/pull/2447","diff_url":"https://github.com/coreos/rkt/pull/2447.diff","patch_url":"https://github.com/coreos/rkt/pull/2447.patch","issue_url":"https://api.github.com/repos/coreos/rkt/issues/2447","number":2447,"state":"open","locked":false,"title":"Find LCA to detect commit differences","user":{"login":"tmrts","id":5067495,"avatar_url":"https://avatars.githubusercontent.com/u/5067495?v=3","gravatar_id":"","url":"https://api.github.com/users/tmrts","html_url":"https://github.com/tmrts","followers_url":"https://api.github.com/users/tmrts/followers","following_url":"https://api.github.com/users/tmrts/following{/other_user}","gists_url":"https://api.github.com/users/tmrts/gists{/gist_id}","starred_url":"https://api.github.com/users/tmrts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmrts/subscriptions","organizations_url":"https://api.github.com/users/tmrts/orgs","repos_url":"https://api.github.com/users/tmrts/repos","events_url":"https://api.github.com/users/tmrts/events{/privacy}","received_events_url":"https://api.github.com/users/tmrts/received_events","type":"User","site_admin":false},"body":"Creates a function to find the lowest common ancestor between two commits.\r\n\r\nFixes #2423","created_at":"2016-04-18T08:57:15Z","updated_at":"2016-04-18T09:45:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24e00ec7e4efecf31fc9e779f6870c9be395dc55","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/coreos/rkt/pulls/2447/commits","review_comments_url":"https://api.github.com/repos/coreos/rkt/pulls/2447/comments","review_comment_url":"https://api.github.com/repos/coreos/rkt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coreos/rkt/issues/2447/comments","statuses_url":"https://api.github.com/repos/coreos/rkt/statuses/8bdd5cc836bcb50c3d7503ef11c98e264b58422c","head":{"label":"tmrts:improve/doc-detection","ref":"improve/doc-detection","sha":"8bdd5cc836bcb50c3d7503ef11c98e264b58422c","user":{"login":"tmrts","id":5067495,"avatar_url":"https://avatars.githubusercontent.com/u/5067495?v=3","gravatar_id":"","url":"https://api.github.com/users/tmrts","html_url":"https://github.com/tmrts","followers_url":"https://api.github.com/users/tmrts/followers","following_url":"https://api.github.com/users/tmrts/following{/other_user}","gists_url":"https://api.github.com/users/tmrts/gists{/gist_id}","starred_url":"https://api.github.com/users/tmrts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmrts/subscriptions","organizations_url":"https://api.github.com/users/tmrts/orgs","repos_url":"https://api.github.com/users/tmrts/repos","events_url":"https://api.github.com/users/tmrts/events{/privacy}","received_events_url":"https://api.github.com/users/tmrts/received_events","type":"User","site_admin":false},"repo":{"id":56485972,"name":"rkt","full_name":"tmrts/rkt","owner":{"login":"tmrts","id":5067495,"avatar_url":"https://avatars.githubusercontent.com/u/5067495?v=3","gravatar_id":"","url":"https://api.github.com/users/tmrts","html_url":"https://github.com/tmrts","followers_url":"https://api.github.com/users/tmrts/followers","following_url":"https://api.github.com/users/tmrts/following{/other_user}","gists_url":"https://api.github.com/users/tmrts/gists{/gist_id}","starred_url":"https://api.github.com/users/tmrts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmrts/subscriptions","organizations_url":"https://api.github.com/users/tmrts/orgs","repos_url":"https://api.github.com/users/tmrts/repos","events_url":"https://api.github.com/users/tmrts/events{/privacy}","received_events_url":"https://api.github.com/users/tmrts/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tmrts/rkt","description":"rkt is an App Container runtime for Linux","fork":true,"url":"https://api.github.com/repos/tmrts/rkt","forks_url":"https://api.github.com/repos/tmrts/rkt/forks","keys_url":"https://api.github.com/repos/tmrts/rkt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tmrts/rkt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tmrts/rkt/teams","hooks_url":"https://api.github.com/repos/tmrts/rkt/hooks","issue_events_url":"https://api.github.com/repos/tmrts/rkt/issues/events{/number}","events_url":"https://api.github.com/repos/tmrts/rkt/events","assignees_url":"https://api.github.com/repos/tmrts/rkt/assignees{/user}","branches_url":"https://api.github.com/repos/tmrts/rkt/branches{/branch}","tags_url":"https://api.github.com/repos/tmrts/rkt/tags","blobs_url":"https://api.github.com/repos/tmrts/rkt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tmrts/rkt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tmrts/rkt/git/refs{/sha}","trees_url":"https://api.github.com/repos/tmrts/rkt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tmrts/rkt/statuses/{sha}","languages_url":"https://api.github.com/repos/tmrts/rkt/languages","stargazers_url":"https://api.github.com/repos/tmrts/rkt/stargazers","contributors_url":"https://api.github.com/repos/tmrts/rkt/contributors","subscribers_url":"https://api.github.com/repos/tmrts/rkt/subscribers","subscription_url":"https://api.github.com/repos/tmrts/rkt/subscription","commits_url":"https://api.github.com/repos/tmrts/rkt/commits{/sha}","git_commits_url":"https://api.github.com/repos/tmrts/rkt/git/commits{/sha}","comments_url":"https://api.github.com/repos/tmrts/rkt/comments{/number}","issue_comment_url":"https://api.github.com/repos/tmrts/rkt/issues/comments{/number}","contents_url":"https://api.github.com/repos/tmrts/rkt/contents/{+path}","compare_url":"https://api.github.com/repos/tmrts/rkt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tmrts/rkt/merges","archive_url":"https://api.github.com/repos/tmrts/rkt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tmrts/rkt/downloads","issues_url":"https://api.github.com/repos/tmrts/rkt/issues{/number}","pulls_url":"https://api.github.com/repos/tmrts/rkt/pulls{/number}","milestones_url":"https://api.github.com/repos/tmrts/rkt/milestones{/number}","notifications_url":"https://api.github.com/repos/tmrts/rkt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tmrts/rkt/labels{/name}","releases_url":"https://api.github.com/repos/tmrts/rkt/releases{/id}","deployments_url":"https://api.github.com/repos/tmrts/rkt/deployments","created_at":"2016-04-18T07:21:35Z","updated_at":"2016-04-18T07:21:37Z","pushed_at":"2016-04-18T09:04:22Z","git_url":"git://github.com/tmrts/rkt.git","ssh_url":"git@github.com:tmrts/rkt.git","clone_url":"https://github.com/tmrts/rkt.git","svn_url":"https://github.com/tmrts/rkt","homepage":"","size":19824,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"coreos:master","ref":"master","sha":"f1c6fc610a59d864976d35b1560c2dd6a404057c","user":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"repo":{"id":26509369,"name":"rkt","full_name":"coreos/rkt","owner":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coreos/rkt","description":"rkt is an App Container runtime for Linux","fork":false,"url":"https://api.github.com/repos/coreos/rkt","forks_url":"https://api.github.com/repos/coreos/rkt/forks","keys_url":"https://api.github.com/repos/coreos/rkt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreos/rkt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreos/rkt/teams","hooks_url":"https://api.github.com/repos/coreos/rkt/hooks","issue_events_url":"https://api.github.com/repos/coreos/rkt/issues/events{/number}","events_url":"https://api.github.com/repos/coreos/rkt/events","assignees_url":"https://api.github.com/repos/coreos/rkt/assignees{/user}","branches_url":"https://api.github.com/repos/coreos/rkt/branches{/branch}","tags_url":"https://api.github.com/repos/coreos/rkt/tags","blobs_url":"https://api.github.com/repos/coreos/rkt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreos/rkt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreos/rkt/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreos/rkt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreos/rkt/statuses/{sha}","languages_url":"https://api.github.com/repos/coreos/rkt/languages","stargazers_url":"https://api.github.com/repos/coreos/rkt/stargazers","contributors_url":"https://api.github.com/repos/coreos/rkt/contributors","subscribers_url":"https://api.github.com/repos/coreos/rkt/subscribers","subscription_url":"https://api.github.com/repos/coreos/rkt/subscription","commits_url":"https://api.github.com/repos/coreos/rkt/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreos/rkt/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreos/rkt/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreos/rkt/issues/comments{/number}","contents_url":"https://api.github.com/repos/coreos/rkt/contents/{+path}","compare_url":"https://api.github.com/repos/coreos/rkt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreos/rkt/merges","archive_url":"https://api.github.com/repos/coreos/rkt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreos/rkt/downloads","issues_url":"https://api.github.com/repos/coreos/rkt/issues{/number}","pulls_url":"https://api.github.com/repos/coreos/rkt/pulls{/number}","milestones_url":"https://api.github.com/repos/coreos/rkt/milestones{/number}","notifications_url":"https://api.github.com/repos/coreos/rkt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreos/rkt/labels{/name}","releases_url":"https://api.github.com/repos/coreos/rkt/releases{/id}","deployments_url":"https://api.github.com/repos/coreos/rkt/deployments","created_at":"2014-11-11T23:13:18Z","updated_at":"2016-04-18T09:11:26Z","pushed_at":"2016-04-18T09:04:23Z","git_url":"git://github.com/coreos/rkt.git","ssh_url":"git@github.com:coreos/rkt.git","clone_url":"https://github.com/coreos/rkt.git","svn_url":"https://github.com/coreos/rkt","homepage":"","size":23716,"stargazers_count":5411,"watchers_count":5411,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":497,"mirror_url":null,"open_issues_count":289,"forks":497,"open_issues":289,"watchers":5411,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/rkt/pulls/2447"},"html":{"href":"https://github.com/coreos/rkt/pull/2447"},"issue":{"href":"https://api.github.com/repos/coreos/rkt/issues/2447"},"comments":{"href":"https://api.github.com/repos/coreos/rkt/issues/2447/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/rkt/pulls/2447/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/rkt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coreos/rkt/pulls/2447/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/rkt/statuses/8bdd5cc836bcb50c3d7503ef11c98e264b58422c"}}}}