{"action":"created","issue":{"url":"https://api.github.com/repos/ompl/ompl/issues/80","repository_url":"https://api.github.com/repos/ompl/ompl","labels_url":"https://api.github.com/repos/ompl/ompl/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/ompl/ompl/issues/80/comments","events_url":"https://api.github.com/repos/ompl/ompl/issues/80/events","html_url":"https://github.com/ompl/ompl/pull/80","id":170031083,"number":80,"title":"Document how to use clang-format ","user":{"login":"davetcoleman","id":561060,"avatar_url":"https://avatars.githubusercontent.com/u/561060?v=3","gravatar_id":"","url":"https://api.github.com/users/davetcoleman","html_url":"https://github.com/davetcoleman","followers_url":"https://api.github.com/users/davetcoleman/followers","following_url":"https://api.github.com/users/davetcoleman/following{/other_user}","gists_url":"https://api.github.com/users/davetcoleman/gists{/gist_id}","starred_url":"https://api.github.com/users/davetcoleman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davetcoleman/subscriptions","organizations_url":"https://api.github.com/users/davetcoleman/orgs","repos_url":"https://api.github.com/users/davetcoleman/repos","events_url":"https://api.github.com/users/davetcoleman/events{/privacy}","received_events_url":"https://api.github.com/users/davetcoleman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-08T21:33:56Z","updated_at":"2016-08-09T04:45:04Z","closed_at":"2016-08-09T01:56:03Z","pull_request":{"url":"https://api.github.com/repos/ompl/ompl/pulls/80","html_url":"https://github.com/ompl/ompl/pull/80","diff_url":"https://github.com/ompl/ompl/pull/80.diff","patch_url":"https://github.com/ompl/ompl/pull/80.patch"},"body":"also adds the config file to base of project\r\n\r\ndoes not actually run clang-format on the code base"},"comment":{"url":"https://api.github.com/repos/ompl/ompl/issues/comments/238452240","html_url":"https://github.com/ompl/ompl/pull/80#issuecomment-238452240","issue_url":"https://api.github.com/repos/ompl/ompl/issues/80","id":238452240,"user":{"login":"davetcoleman","id":561060,"avatar_url":"https://avatars.githubusercontent.com/u/561060?v=3","gravatar_id":"","url":"https://api.github.com/users/davetcoleman","html_url":"https://github.com/davetcoleman","followers_url":"https://api.github.com/users/davetcoleman/followers","following_url":"https://api.github.com/users/davetcoleman/following{/other_user}","gists_url":"https://api.github.com/users/davetcoleman/gists{/gist_id}","starred_url":"https://api.github.com/users/davetcoleman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davetcoleman/subscriptions","organizations_url":"https://api.github.com/users/davetcoleman/orgs","repos_url":"https://api.github.com/users/davetcoleman/repos","events_url":"https://api.github.com/users/davetcoleman/events{/privacy}","received_events_url":"https://api.github.com/users/davetcoleman/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T04:45:04Z","updated_at":"2016-08-09T04:45:04Z","body":"I have a large set of changes in my fork of OMPL (not high quality code) that I just tried to sync with the master branch after the clang-format changes. It was harder than I expected, so I'm documenting how I found it easiest to do the migration. Make sure you backup your fork/branches first.\r\n\r\n1) pulled down the master branch and reverted it to the commit right before clang-format was run. this let me easily integrate all the other C++11 changes @mamoll made recently (i rebased a few weeks ago but things are changing fast in OMPL it seems)\r\n\r\n    git co master\r\n    git reset --hard 249b49c33e609ae4e01a0243b28a61b1a6de0cf3 \r\n\r\n2) checked out my custom branch\r\n\r\n    git co my_branch\r\n\r\n3) synced with the master (again, without the clang-format step)\r\n\r\n    git merge master\r\n\r\n4) fixed all the conflicts, because of your C++11 stuff\r\n\r\n****\r\nNote: the above is normal stuff you would have to do anyway irregardless of clang-format. now it gets a little trickier:\r\n\r\n5) next I manually pulled down the ``.clang-format`` file:\r\n\r\n```\r\nwget https://raw.githubusercontent.com/ompl/ompl/master/.clang-format\r\n```\r\n\r\n6) then I ran it on my branch so that the formatting looks exactly the same as OMPL's. only run it in the src folder of ompl\r\n\r\n```\r\ncd ompl/src/ompl\r\nfind . -name '*.h' -or -name '*.hpp' -or -name '*.cpp' | xargs clang-format-3.6 --i -style=file $1\r\n```\r\n\r\n7) i think there is a much better way to do this last step, but what i did was simply make a copy of the whole ompl folder outside the root of the ompl repo\r\n\r\n    cp -r /ompl /ompl_mine\r\n\r\n8) i checked out the master branch again instead of my branch\r\n\r\n    git reset --hard HEAD\r\n    git co master\r\n    git rebase upstream/master\r\n\r\n9) then i just copied my diff ontop the master branch\r\n\r\n    cp -r /ompl_mine /ompl\r\n\r\n10) now ``git diff`` is only the changes i've made over the years, with the exact formatting\r\n\r\n11) commit back to my forked branch\r\n\r\n    git co my_branch\r\n    git commit -a -m \"all my custom ompl code\""}}
{"actor":{"display_login":"davetcoleman"}}