{"action":"created","comment":{"url":"https://api.github.com/repos/goabstract/monorepo-tools/pulls/comments/235535464","pull_request_review_id":177425217,"id":235535464,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTUzNTQ2NA==","diff_hunk":"@@ -2,23 +2,26 @@\n \n # Delete all local branches and create all non-remote-tracking branches of a specified remote\n #\n-# Usage: load_branches_from_remote.sh <remote-name>\n+# Usage: load_branches_from_remote.sh <remote-name> <branch-prefix> [--master]\n #\n-# Example: load_branches_from_remote.sh origin\n+# Example: load_branches_from_remote.sh origin packages/package-a --master\n \n REMOTE=$1\n+PREFIX=$2\n+INCLUDE_MASTER=${@:3}\n+\n echo \"Loading all branches from the remote '$REMOTE' (all local branches are deleted)\"\n-# Checking out orphan commit so it 's possible to delete current branch\n-git checkout --orphan void\n-# Delete all local branches\n-for BRANCH in `git branch`; do\n-    git branch -D $BRANCH\n-done\n # Create non-remote-tracking branches from selected remote\n for REMOTE_BRANCH in $(git branch -r|grep $REMOTE/); do\n     BRANCH=${REMOTE_BRANCH/$REMOTE\\//}\n-    git branch -q $BRANCH $REMOTE_BRANCH\n-    git branch --unset-upstream $BRANCH\n+\n+    if [ \"$BRANCH\" == \"master\" ] && [ \"$INCLUDE_MASTER\" == \"--master\" ]; then\n+        git branch -q $BRANCH $REMOTE_BRANCH\n+        git branch --unset-upstream $BRANCH\n+    elif [ \"$BRANCH\" != \"master\" ]; then\n+        git branch -q $PREFIX--$BRANCH $REMOTE_BRANCH","path":"load_branches_from_remote.sh","position":31,"original_position":31,"commit_id":"9c86e3b5fa175ac5b8f566f8e21fc3aa44a571e0","original_commit_id":"3e59f41d4220d8473d3abbb86a99188576faa629","user":{"login":"rickharris","id":216355,"node_id":"MDQ6VXNlcjIxNjM1NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/216355?v=4","gravatar_id":"","url":"https://api.github.com/users/rickharris","html_url":"https://github.com/rickharris","followers_url":"https://api.github.com/users/rickharris/followers","following_url":"https://api.github.com/users/rickharris/following{/other_user}","gists_url":"https://api.github.com/users/rickharris/gists{/gist_id}","starred_url":"https://api.github.com/users/rickharris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickharris/subscriptions","organizations_url":"https://api.github.com/users/rickharris/orgs","repos_url":"https://api.github.com/users/rickharris/repos","events_url":"https://api.github.com/users/rickharris/events{/privacy}","received_events_url":"https://api.github.com/users/rickharris/received_events","type":"User","site_admin":false},"body":"since we mostly use single dashes in branch names already it seemed like a clearer separator","created_at":"2018-11-21T20:52:31Z","updated_at":"2018-11-21T20:52:31Z","html_url":"https://github.com/goabstract/monorepo-tools/pull/1#discussion_r235535464","pull_request_url":"https://api.github.com/repos/goabstract/monorepo-tools/pulls/1","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/goabstract/monorepo-tools/pulls/comments/235535464"},"html":{"href":"https://github.com/goabstract/monorepo-tools/pull/1#discussion_r235535464"},"pull_request":{"href":"https://api.github.com/repos/goabstract/monorepo-tools/pulls/1"}},"in_reply_to_id":235505768},"pull_request":{"url":"https://api.github.com/repos/goabstract/monorepo-tools/pulls/1","id":232767460,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNzY3NDYw","html_url":"https://github.com/goabstract/monorepo-tools/pull/1","diff_url":"https://github.com/goabstract/monorepo-tools/pull/1.diff","patch_url":"https://github.com/goabstract/monorepo-tools/pull/1.patch","issue_url":"https://api.github.com/repos/goabstract/monorepo-tools/issues/1","number":1,"state":"open","locked":false,"title":"import all branches w/ subdirectory prefix","user":{"login":"rickharris","id":216355,"node_id":"MDQ6VXNlcjIxNjM1NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/216355?v=4","gravatar_id":"","url":"https://api.github.com/users/rickharris","html_url":"https://github.com/rickharris","followers_url":"https://api.github.com/users/rickharris/followers","following_url":"https://api.github.com/users/rickharris/following{/other_user}","gists_url":"https://api.github.com/users/rickharris/gists{/gist_id}","starred_url":"https://api.github.com/users/rickharris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickharris/subscriptions","organizations_url":"https://api.github.com/users/rickharris/orgs","repos_url":"https://api.github.com/users/rickharris/repos","events_url":"https://api.github.com/users/rickharris/events{/privacy}","received_events_url":"https://api.github.com/users/rickharris/received_events","type":"User","site_admin":false},"body":"Fixed up branch import so that all branches are imported from all repos, with prefixes to avoid branch conflicts. I'd like explain in-line the changes I made to double-check that it makes sense to other people as well.\r\n\r\nI've tested this a lot on smaller repos (I created a small monorepo from goabstract/abstract-sdk and goabstract-eslint-config), and just did a big import of core, desktop, and web just now and things look good.\r\n","created_at":"2018-11-21T18:52:27Z","updated_at":"2018-11-21T20:52:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"84f422d7ce79525934c826d5c9053f88a85b5a13","assignee":null,"assignees":[],"requested_reviewers":[{"login":"commondream","id":5594,"node_id":"MDQ6VXNlcjU1OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/5594?v=4","gravatar_id":"","url":"https://api.github.com/users/commondream","html_url":"https://github.com/commondream","followers_url":"https://api.github.com/users/commondream/followers","following_url":"https://api.github.com/users/commondream/following{/other_user}","gists_url":"https://api.github.com/users/commondream/gists{/gist_id}","starred_url":"https://api.github.com/users/commondream/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commondream/subscriptions","organizations_url":"https://api.github.com/users/commondream/orgs","repos_url":"https://api.github.com/users/commondream/repos","events_url":"https://api.github.com/users/commondream/events{/privacy}","received_events_url":"https://api.github.com/users/commondream/received_events","type":"User","site_admin":false},{"login":"amccloud","id":38463,"node_id":"MDQ6VXNlcjM4NDYz","avatar_url":"https://avatars0.githubusercontent.com/u/38463?v=4","gravatar_id":"","url":"https://api.github.com/users/amccloud","html_url":"https://github.com/amccloud","followers_url":"https://api.github.com/users/amccloud/followers","following_url":"https://api.github.com/users/amccloud/following{/other_user}","gists_url":"https://api.github.com/users/amccloud/gists{/gist_id}","starred_url":"https://api.github.com/users/amccloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amccloud/subscriptions","organizations_url":"https://api.github.com/users/amccloud/orgs","repos_url":"https://api.github.com/users/amccloud/repos","events_url":"https://api.github.com/users/amccloud/events{/privacy}","received_events_url":"https://api.github.com/users/amccloud/received_events","type":"User","site_admin":false},{"login":"thenanyu","id":427579,"node_id":"MDQ6VXNlcjQyNzU3OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/427579?v=4","gravatar_id":"","url":"https://api.github.com/users/thenanyu","html_url":"https://github.com/thenanyu","followers_url":"https://api.github.com/users/thenanyu/followers","following_url":"https://api.github.com/users/thenanyu/following{/other_user}","gists_url":"https://api.github.com/users/thenanyu/gists{/gist_id}","starred_url":"https://api.github.com/users/thenanyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thenanyu/subscriptions","organizations_url":"https://api.github.com/users/thenanyu/orgs","repos_url":"https://api.github.com/users/thenanyu/repos","events_url":"https://api.github.com/users/thenanyu/events{/privacy}","received_events_url":"https://api.github.com/users/thenanyu/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/goabstract/monorepo-tools/pulls/1/commits","review_comments_url":"https://api.github.com/repos/goabstract/monorepo-tools/pulls/1/comments","review_comment_url":"https://api.github.com/repos/goabstract/monorepo-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/goabstract/monorepo-tools/issues/1/comments","statuses_url":"https://api.github.com/repos/goabstract/monorepo-tools/statuses/9c86e3b5fa175ac5b8f566f8e21fc3aa44a571e0","head":{"label":"goabstract:import-all-branches","ref":"import-all-branches","sha":"9c86e3b5fa175ac5b8f566f8e21fc3aa44a571e0","user":{"login":"goabstract","id":18014107,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MDE0MTA3","avatar_url":"https://avatars3.githubusercontent.com/u/18014107?v=4","gravatar_id":"","url":"https://api.github.com/users/goabstract","html_url":"https://github.com/goabstract","followers_url":"https://api.github.com/users/goabstract/followers","following_url":"https://api.github.com/users/goabstract/following{/other_user}","gists_url":"https://api.github.com/users/goabstract/gists{/gist_id}","starred_url":"https://api.github.com/users/goabstract/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goabstract/subscriptions","organizations_url":"https://api.github.com/users/goabstract/orgs","repos_url":"https://api.github.com/users/goabstract/repos","events_url":"https://api.github.com/users/goabstract/events{/privacy}","received_events_url":"https://api.github.com/users/goabstract/received_events","type":"Organization","site_admin":false},"repo":{"id":158589236,"node_id":"MDEwOlJlcG9zaXRvcnkxNTg1ODkyMzY=","name":"monorepo-tools","full_name":"goabstract/monorepo-tools","private":false,"owner":{"login":"goabstract","id":18014107,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MDE0MTA3","avatar_url":"https://avatars3.githubusercontent.com/u/18014107?v=4","gravatar_id":"","url":"https://api.github.com/users/goabstract","html_url":"https://github.com/goabstract","followers_url":"https://api.github.com/users/goabstract/followers","following_url":"https://api.github.com/users/goabstract/following{/other_user}","gists_url":"https://api.github.com/users/goabstract/gists{/gist_id}","starred_url":"https://api.github.com/users/goabstract/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goabstract/subscriptions","organizations_url":"https://api.github.com/users/goabstract/orgs","repos_url":"https://api.github.com/users/goabstract/repos","events_url":"https://api.github.com/users/goabstract/events{/privacy}","received_events_url":"https://api.github.com/users/goabstract/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/goabstract/monorepo-tools","description":"[READ-ONLY] Tools for building and splitting monolithic repository from existing packages (with their history unchanged)","fork":true,"url":"https://api.github.com/repos/goabstract/monorepo-tools","forks_url":"https://api.github.com/repos/goabstract/monorepo-tools/forks","keys_url":"https://api.github.com/repos/goabstract/monorepo-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/goabstract/monorepo-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/goabstract/monorepo-tools/teams","hooks_url":"https://api.github.com/repos/goabstract/monorepo-tools/hooks","issue_events_url":"https://api.github.com/repos/goabstract/monorepo-tools/issues/events{/number}","events_url":"https://api.github.com/repos/goabstract/monorepo-tools/events","assignees_url":"https://api.github.com/repos/goabstract/monorepo-tools/assignees{/user}","branches_url":"https://api.github.com/repos/goabstract/monorepo-tools/branches{/branch}","tags_url":"https://api.github.com/repos/goabstract/monorepo-tools/tags","blobs_url":"https://api.github.com/repos/goabstract/monorepo-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/goabstract/monorepo-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/goabstract/monorepo-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/goabstract/monorepo-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/goabstract/monorepo-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/goabstract/monorepo-tools/languages","stargazers_url":"https://api.github.com/repos/goabstract/monorepo-tools/stargazers","contributors_url":"https://api.github.com/repos/goabstract/monorepo-tools/contributors","subscribers_url":"https://api.github.com/repos/goabstract/monorepo-tools/subscribers","subscription_url":"https://api.github.com/repos/goabstract/monorepo-tools/subscription","commits_url":"https://api.github.com/repos/goabstract/monorepo-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/goabstract/monorepo-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/goabstract/monorepo-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/goabstract/monorepo-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/goabstract/monorepo-tools/contents/{+path}","compare_url":"https://api.github.com/repos/goabstract/monorepo-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/goabstract/monorepo-tools/merges","archive_url":"https://api.github.com/repos/goabstract/monorepo-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/goabstract/monorepo-tools/downloads","issues_url":"https://api.github.com/repos/goabstract/monorepo-tools/issues{/number}","pulls_url":"https://api.github.com/repos/goabstract/monorepo-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/goabstract/monorepo-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/goabstract/monorepo-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/goabstract/monorepo-tools/labels{/name}","releases_url":"https://api.github.com/repos/goabstract/monorepo-tools/releases{/id}","deployments_url":"https://api.github.com/repos/goabstract/monorepo-tools/deployments","created_at":"2018-11-21T18:17:06Z","updated_at":"2018-11-21T18:17:08Z","pushed_at":"2018-11-21T20:31:24Z","git_url":"git://github.com/goabstract/monorepo-tools.git","ssh_url":"git@github.com:goabstract/monorepo-tools.git","clone_url":"https://github.com/goabstract/monorepo-tools.git","svn_url":"https://github.com/goabstract/monorepo-tools","homepage":"","size":29,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"goabstract:master","ref":"master","sha":"0d748244a7c34536a45c9fa247642e1a7d67e82a","user":{"login":"goabstract","id":18014107,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MDE0MTA3","avatar_url":"https://avatars3.githubusercontent.com/u/18014107?v=4","gravatar_id":"","url":"https://api.github.com/users/goabstract","html_url":"https://github.com/goabstract","followers_url":"https://api.github.com/users/goabstract/followers","following_url":"https://api.github.com/users/goabstract/following{/other_user}","gists_url":"https://api.github.com/users/goabstract/gists{/gist_id}","starred_url":"https://api.github.com/users/goabstract/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goabstract/subscriptions","organizations_url":"https://api.github.com/users/goabstract/orgs","repos_url":"https://api.github.com/users/goabstract/repos","events_url":"https://api.github.com/users/goabstract/events{/privacy}","received_events_url":"https://api.github.com/users/goabstract/received_events","type":"Organization","site_admin":false},"repo":{"id":158589236,"node_id":"MDEwOlJlcG9zaXRvcnkxNTg1ODkyMzY=","name":"monorepo-tools","full_name":"goabstract/monorepo-tools","private":false,"owner":{"login":"goabstract","id":18014107,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MDE0MTA3","avatar_url":"https://avatars3.githubusercontent.com/u/18014107?v=4","gravatar_id":"","url":"https://api.github.com/users/goabstract","html_url":"https://github.com/goabstract","followers_url":"https://api.github.com/users/goabstract/followers","following_url":"https://api.github.com/users/goabstract/following{/other_user}","gists_url":"https://api.github.com/users/goabstract/gists{/gist_id}","starred_url":"https://api.github.com/users/goabstract/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goabstract/subscriptions","organizations_url":"https://api.github.com/users/goabstract/orgs","repos_url":"https://api.github.com/users/goabstract/repos","events_url":"https://api.github.com/users/goabstract/events{/privacy}","received_events_url":"https://api.github.com/users/goabstract/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/goabstract/monorepo-tools","description":"[READ-ONLY] Tools for building and splitting monolithic repository from existing packages (with their history unchanged)","fork":true,"url":"https://api.github.com/repos/goabstract/monorepo-tools","forks_url":"https://api.github.com/repos/goabstract/monorepo-tools/forks","keys_url":"https://api.github.com/repos/goabstract/monorepo-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/goabstract/monorepo-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/goabstract/monorepo-tools/teams","hooks_url":"https://api.github.com/repos/goabstract/monorepo-tools/hooks","issue_events_url":"https://api.github.com/repos/goabstract/monorepo-tools/issues/events{/number}","events_url":"https://api.github.com/repos/goabstract/monorepo-tools/events","assignees_url":"https://api.github.com/repos/goabstract/monorepo-tools/assignees{/user}","branches_url":"https://api.github.com/repos/goabstract/monorepo-tools/branches{/branch}","tags_url":"https://api.github.com/repos/goabstract/monorepo-tools/tags","blobs_url":"https://api.github.com/repos/goabstract/monorepo-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/goabstract/monorepo-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/goabstract/monorepo-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/goabstract/monorepo-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/goabstract/monorepo-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/goabstract/monorepo-tools/languages","stargazers_url":"https://api.github.com/repos/goabstract/monorepo-tools/stargazers","contributors_url":"https://api.github.com/repos/goabstract/monorepo-tools/contributors","subscribers_url":"https://api.github.com/repos/goabstract/monorepo-tools/subscribers","subscription_url":"https://api.github.com/repos/goabstract/monorepo-tools/subscription","commits_url":"https://api.github.com/repos/goabstract/monorepo-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/goabstract/monorepo-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/goabstract/monorepo-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/goabstract/monorepo-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/goabstract/monorepo-tools/contents/{+path}","compare_url":"https://api.github.com/repos/goabstract/monorepo-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/goabstract/monorepo-tools/merges","archive_url":"https://api.github.com/repos/goabstract/monorepo-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/goabstract/monorepo-tools/downloads","issues_url":"https://api.github.com/repos/goabstract/monorepo-tools/issues{/number}","pulls_url":"https://api.github.com/repos/goabstract/monorepo-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/goabstract/monorepo-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/goabstract/monorepo-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/goabstract/monorepo-tools/labels{/name}","releases_url":"https://api.github.com/repos/goabstract/monorepo-tools/releases{/id}","deployments_url":"https://api.github.com/repos/goabstract/monorepo-tools/deployments","created_at":"2018-11-21T18:17:06Z","updated_at":"2018-11-21T18:17:08Z","pushed_at":"2018-11-21T20:31:24Z","git_url":"git://github.com/goabstract/monorepo-tools.git","ssh_url":"git@github.com:goabstract/monorepo-tools.git","clone_url":"https://github.com/goabstract/monorepo-tools.git","svn_url":"https://github.com/goabstract/monorepo-tools","homepage":"","size":29,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/goabstract/monorepo-tools/pulls/1"},"html":{"href":"https://github.com/goabstract/monorepo-tools/pull/1"},"issue":{"href":"https://api.github.com/repos/goabstract/monorepo-tools/issues/1"},"comments":{"href":"https://api.github.com/repos/goabstract/monorepo-tools/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/goabstract/monorepo-tools/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/goabstract/monorepo-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/goabstract/monorepo-tools/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/goabstract/monorepo-tools/statuses/9c86e3b5fa175ac5b8f566f8e21fc3aa44a571e0"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"rickharris"}}