Skip to content

Instantly share code, notes, and snippets.

@ryanhanks-wf
Created February 19, 2014 21:45
Show Gist options
  • Select an option

  • Save ryanhanks-wf/9102348 to your computer and use it in GitHub Desktop.

Select an option

Save ryanhanks-wf/9102348 to your computer and use it in GitHub Desktop.
#!/usr/bin/env zsh
merge_branch=BOOKS-3679
merge_branch_base=wf-book-common/master
bigsky_merge_parent=origin/master
pushd bigsky
git fetch origin
git fetch tony
git fetch wf-book-common
git fetch wf-book-viewer
git fetch wf-book-editor
bigsky_merge_parent_commit=$(git rev-parse $bigsky_merge_parent)
bigsky_merge_parent_commit=aabc3bec4b24326a619808b9d9a61a5763083597
# bigsky_merge_parent_commit=7062d2b
bigsky_merge_parent_commit=6599a15
create_merge_branch(){
git checkout --detach -q
git reset --hard -q
git clean -xdf -q
git branch -D $merge_branch -q
git clean -xdfq
git checkout -q -f -b $merge_branch $merge_branch_base
}
create_merge_branch
merge_subtree(){
src=books/$1
dest=$2
git checkout -q $bigsky_merge_parent_commit
git filter-branch -f --subdirectory-filter $src --prune-empty
merge_head=$(git rev-parse HEAD)
git checkout -q -f $merge_branch
git subtree merge --squash --prefix=$dest $merge_head -m "merge in latest $dest from $src @ $bigsky_merge_parent_commit"
}
merge_subtree app/js/common src
merge_subtree app/js/test/spec/common test/spec
merge_subtree app/partials/common partials
merge_subtree scss styles
merge_subtree app/img images
# merge_subtree app/js/test/spec/viewer test/spec
# merge_subtree app/js/viewer app/scripts
# merge_subtree app/partials/viewer app/partials
# merge_subtree app/js/editor app/scripts
# merge_subtree app/partials/editor app/partials
# merge_subtree app/js/test/spec/editor test/spec
popd
# push_master_update_branch_to_rc_tag common 0.3.0 1
# viewer
# merge_subtree app/js/test/spec/viewer test/spec
# merge_subtree app/js/viewer app/scripts
# merge_subtree app/partials/viewer app/partials
# bump_bower_tag common 0.3.0 1
# push_master_update_branch_to_rc_tag viewer 0.3.0 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment