{"action":"created","issue":{"url":"https://api.github.com/repos/scala/scala/issues/4765","labels_url":"https://api.github.com/repos/scala/scala/issues/4765/labels{/name}","comments_url":"https://api.github.com/repos/scala/scala/issues/4765/comments","events_url":"https://api.github.com/repos/scala/scala/issues/4765/events","html_url":"https://github.com/scala/scala/pull/4765","id":108007847,"number":4765,"title":"Script to compare the current scaladoc with the parent commit's doc","user":{"login":"janekdb","id":1123855,"avatar_url":"https://avatars.githubusercontent.com/u/1123855?v=3","gravatar_id":"","url":"https://api.github.com/users/janekdb","html_url":"https://github.com/janekdb","followers_url":"https://api.github.com/users/janekdb/followers","following_url":"https://api.github.com/users/janekdb/following{/other_user}","gists_url":"https://api.github.com/users/janekdb/gists{/gist_id}","starred_url":"https://api.github.com/users/janekdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janekdb/subscriptions","organizations_url":"https://api.github.com/users/janekdb/orgs","repos_url":"https://api.github.com/users/janekdb/repos","events_url":"https://api.github.com/users/janekdb/events{/privacy}","received_events_url":"https://api.github.com/users/janekdb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/scala/scala/milestones/49","html_url":"https://github.com/scala/scala/milestones/2.11.8","labels_url":"https://api.github.com/repos/scala/scala/milestones/49/labels","id":1169165,"number":49,"title":"2.11.8","description":"Merge to 2.11.x.\r\n","creator":{"login":"SethTisue","id":161079,"avatar_url":"https://avatars.githubusercontent.com/u/161079?v=3","gravatar_id":"","url":"https://api.github.com/users/SethTisue","html_url":"https://github.com/SethTisue","followers_url":"https://api.github.com/users/SethTisue/followers","following_url":"https://api.github.com/users/SethTisue/following{/other_user}","gists_url":"https://api.github.com/users/SethTisue/gists{/gist_id}","starred_url":"https://api.github.com/users/SethTisue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SethTisue/subscriptions","organizations_url":"https://api.github.com/users/SethTisue/orgs","repos_url":"https://api.github.com/users/SethTisue/repos","events_url":"https://api.github.com/users/SethTisue/events{/privacy}","received_events_url":"https://api.github.com/users/SethTisue/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":130,"state":"open","created_at":"2015-06-17T19:08:28Z","updated_at":"2015-10-14T15:20:58Z","due_on":"2015-10-25T23:00:00Z","closed_at":null},"comments":5,"created_at":"2015-09-23T21:14:09Z","updated_at":"2015-10-14T16:16:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scala/scala/pulls/4765","html_url":"https://github.com/scala/scala/pull/4765","diff_url":"https://github.com/scala/scala/pull/4765.diff","patch_url":"https://github.com/scala/scala/pull/4765.patch"},"body":"This commit was extracted from #4760 to make that PR less diverse.\r\n\r\n:ok_hand: LGTM on Ubuntu.\r\n\r\n## Activity Log\r\n\r\nThis script does not work for me yet. Ideally this would also be tested by others on different UNIXes.\r\n\r\nPlease pull, test locally and provide comments or patches.\r\n\r\n## :hotsprings: TODO\r\n - [x] Fix `issue 1`. (46f717fef07086d8acc3ba3ed3b468979a55ee2a)\r\n - [x] Fix `issue 2`. (8380096da92fe276aaeb98702cc28acad18924ea)\r\n - [x] Fix `issue 3`.\r\n - [x] Fix `issue 4`. (fafa2995ea19f93bfc2b1542f79ebd2e564cea95)\r\n - [x] Ensure running the script twice copies the scaladoc to the same location. (9373058467c8205c25ac7900aded62a74b946074)\r\n - [x] Consider `issue 5`. (0315e78816d03619ac01c747671f9d0b68efbfe9)\r\n - [x] Fix `issue 6.\r\n - [x] Check missing new files are detected.\r\n - [x] Check missing old files are detected.\r\n - [x] Test on `Ubuntu 14.04.3 LTS`.\r\n - [x] Test on `OSX` - Help welcomed! :beer: :beer: :beer: :beer:\r\n - [x] Squash commits down to two.\r\n - [x] Extend any tooling overview documentation that already exists. Outcome: No update required.\r\n - [x] Take off hold.\r\n - [x] Add reviewers.\r\n\r\n## :mount_fuji: Deferred\r\n\r\n - [ ] Add optional param to allow using any ref as the oldsha (HEAD~6 for example)\r\n\r\n## Known Issues\r\n\r\n*none*\r\n\r\n## Fixed Issues\r\n\r\n### :white_check_mark: Issue 1\r\n\r\nOS: Ubuntu 14.04.3 LTS\r\n\r\n`not found` & `Bad substitution` errors,\r\n\r\n    21:58 $ ./tools/scaladoc-diff \r\n    tools/get-scala-commit-sha: 11: tools/get-scala-commit-sha: [[: not found\r\n    tools/get-scala-commit-sha: 17: tools/get-scala-commit-sha: Bad substitution\r\n    parent commit sha: a6c1687aa7. current commit sha: \r\n    making scaladoc for parent commit (a6c1687aa7)\r\n    Note: checking out 'HEAD^'.\r\n\r\n    You are in 'detached HEAD' state. You can look around, make experimental\r\n    changes and commit them, and you can discard any commits you make in this\r\n    state without impacting any branches by performing another checkout.\r\n\r\n    If you want to create a new branch to retain commits you create, you may\r\n    do so (now or later) by using -b with the checkout command again. Example:\r\n\r\n      git checkout -b new_branch_name\r\n\r\n    HEAD is now at a6c1687... Merge pull request #4757 from lrytz/t9375-2.11\r\n\r\n### :white_check_mark: Issue 2\r\n\r\nOS: Ubuntu 14.04.3 LTS\r\n\r\nThe script uses `opendiff` which is not present by default on this OS. At the very least the script should preflight the existence of all required commands if there is any reasonable chance they will not be present.\r\n\r\nSolution: Check for these commands in order and use the first found,\r\n\r\n* opendiff\r\n* meld\r\n* gvimdiff\r\n* diff -y old new | less\r\n\r\n### :white_check_mark: Issue 3\r\n\r\nOS: Ubuntu 14.04.3 LTS\r\n\r\nScalaDoc `$ ant docs` & `$ ant docs.lib` does not build for @janekdb. Discussion on https://groups.google.com/forum/#!topic/scala-internals/VMzPo_tHL00\r\n\r\nSolution: `ant clean build`\r\n\r\n### :white_check_mark: Issue 4\r\n\r\nOS: Ubuntu 14.04.3 LTS\r\n\r\nThe script uses `open` which is specific to Mac OS X.\r\n\r\nSolution: Check for these commands in order and use the first found,\r\n\r\n* open\r\n* gedit\r\n* less\r\n\r\nopen: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/open.1.html\r\n\r\n### :white_check_mark: Issue 5\r\n\r\nWhen the working directory is restored with `git checkout $sha` the repo ends in a detached head state. Look for a way to restore the starting branch if possible.\r\n\r\n* Determine initial branch\r\n* If start state was a branch checkout the branch instead of the initial sha when restoring the working directory.\r\n\r\nThis can be used\r\n\r\n    git symbolic-ref -q --short HEAD\r\n\r\nWhen on a branch it exits normally with the branch name, if on a detached head there is an error status code and then the short `SHA1` can be captured instead.\r\n\r\n### :white_check_mark: Issue 6\r\n\r\nOS: Ubuntu 14.04.3 LTS\r\n\r\nInvoke `scaladoc-compare` with `bash` instead of `sh` to avoid *bad substitution* error,\r\n\r\n    sh tools/scaladoc-compare build/scaladoc-${sha}/ build/scaladoc-$oldsha/ &> $difffile\r\n"},"comment":{"url":"https://api.github.com/repos/scala/scala/issues/comments/148103757","html_url":"https://github.com/scala/scala/pull/4765#issuecomment-148103757","issue_url":"https://api.github.com/repos/scala/scala/issues/4765","id":148103757,"user":{"login":"som-snytt","id":369425,"avatar_url":"https://avatars.githubusercontent.com/u/369425?v=3","gravatar_id":"","url":"https://api.github.com/users/som-snytt","html_url":"https://github.com/som-snytt","followers_url":"https://api.github.com/users/som-snytt/followers","following_url":"https://api.github.com/users/som-snytt/following{/other_user}","gists_url":"https://api.github.com/users/som-snytt/gists{/gist_id}","starred_url":"https://api.github.com/users/som-snytt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/som-snytt/subscriptions","organizations_url":"https://api.github.com/users/som-snytt/orgs","repos_url":"https://api.github.com/users/som-snytt/repos","events_url":"https://api.github.com/users/som-snytt/events{/privacy}","received_events_url":"https://api.github.com/users/som-snytt/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T16:16:00Z","updated_at":"2015-10-14T16:16:00Z","body":"I haven't had a chance to try the goodness yet, but I did wonder if we're assuming `git` why not `git diff`? Partest prefers `git diff` because paulp did too."}}