The Node.js master
branch is constantly evolving. The chakracore-master
branch is also evolving, both by fixing breaking changes from master
and by landing new things, making it better. The goal of the chakracore-master
branch is to produce a set of easy to review commits, that can be used to open a pull request against master
.
For the master
branch in a given moment (tagged master-DATE
), we can create a chakracore-DATE
branch that represents the state of ChakraCore on Node for that revision of master
. When updating master
, the dated chakracore
branch should be rebased against the new dated master
branch, creating a new dated chakracore
branch using a pull request. Updates to ChakraCore and ChakraShim should either replace the commits of the original versions, or, if the update should be separated, have a different pull request. A chakracore-master
branch can be created pointing to the most recent version of ChakraCore on Node, being force pushed only when the updates from master
land.
Pull requests should be open against the chakracore-master
branch. This will flood the pull request with old commits when the branch is force pushed, but allows for the pull request to be updated without opening a new one.
We should decide if changes land in chakracore-master
or in the most recent dated chakracore
branch. Either way, when updating master, all changes should be included in the new dated chakracore
branch.
Pull requests can be fixups to previous commits, we should decide if fixups are applied when landing (force-pushing the target branch) or only when updating master
(leveraging the rebase).
(Assuming use of Git Bash)
TODAY=$(date +%Y%m%d)
git reset --hard
git clean -fdx
git checkout master
git tag master-$TODAY
git branch chakracore-$TODAY
git checkout -b chakracore-${TODAY}-staging chakracore-master
git rebase chakracore-$TODAY # solve conflicts
# Apply updates, squash or fixup
git rebase -i master-$TODAY
- Base:
chakracore-$TODAY
- Head:
chakracore-${TODAY}-staging
Make sure all landed pull requests are rebased and included in the new branch.
git checkout chakracore-$TODAY
git merge --ff-only chakracore-${TODAY}-staging
git branch -d chakracore-${TODAY}-staging
git branch -f chakracore-master
This shows how rebasing would have applied to the previous updates.
The resulting changes are easy to review: https://github.com/janeasystems/node-chakracore-rebased/compare/master...chakracore-master .
git init
git pull https://github.com/nodejs/node.git
git fetch -n https://github.com/nodejs/node.git +refs/pull/4765/head:refs/heads/pull/4765
git fetch -n https://github.com/nodejs/node-chakracore.git +refs/pull/25/head:refs/heads/pull/25 +refs/pull/30/head:refs/heads/pull/30
The original PR, nodejs/node#4765
- Base: https://github.com/nodejs/node/commit/6efa0311681a6137be02c42104cfefa415fe94eb , dated December 30, 2015
- Head: https://github.com/nodejs/node-chakracore/commit/19b2e489dda384f17feddcd6c24199b3c6d437a4
- Merged as: https://github.com/nodejs/node-chakracore/commit/42bc2848a89a9f9ee145f9fdfe057465c410b2d9 (the only change when landing was in
README.md
)
git tag master-20151230 6efa031
git branch chakracore-20151230 6efa031
git checkout -b chakracore-20151230-staging 6efa031
git cherry-pick 6efa031..42bc284 # As if the changes were done in this branch
# Would open PR from chakracore-20151230-staging to chakracore-20151230, land with:
git checkout chakracore-20151230
git merge --ff-only chakracore-20151230-staging
git branch -d chakracore-20151230-staging
git branch chakracore-master
The first update PR, nodejs/node-chakracore#25
- Merge from
master
: https://github.com/nodejs/node-chakracore/commit/30623543fcd3e5070a3229353c4e70ff68485519 , based on the previous PR and master commit https://github.com/nodejs/node/commit/7406cd3a59302d50420e3c6c12359ac20094ad24 dated February 3, 2016 - Head: https://github.com/nodejs/node-chakracore/commit/4cf733e69752013ad44aecef32e39388f342144e (3 commits on top of the merge)
- Merged as: https://github.com/nodejs/node-chakracore/commit/1992a831e5fc46c3db25cd6b623b741ea1b65b2c (only metadata changes when landing)
git tag master-20160203 7406cd3
git branch chakracore-20160203 7406cd3
git checkout -b chakracore-20160203-staging chakracore-master
git rebase chakracore-20160203
# The conflicts are the same as by merging, and since they are solved in the PR we can shortcut:
git checkout 1992a83 README.md vcbuild.bat
git rebase --continue
git checkout 1992a83 test/parallel/test-buffer-slow.js test/parallel/test-util-inspect.js test/parallel/test-util-log.js
git rebase --continue
# Then apply the 3 new commits
git cherry-pick 3062354..1992a83
# These 3 new commits should be squashed with the respective original commits to simplify the changes
# (the chakrashim commit needs to be split because of gyp)
git rebase -i master-20160203
# Would open PR from chakracore-20160203-staging to chakracore-20160203, land with:
git checkout chakracore-20160203
git merge --ff-only chakracore-20160203-staging
git branch -d chakracore-20160203-staging
git branch -f chakracore-master
The second update PR, nodejs/node-chakracore#30
- Merge from
master
: https://github.com/nodejs/node-chakracore/commit/e3d86e2163e1912d6e67a05949e47c60bb0185b4 , based on the previous PR and master commit https://github.com/nodejs/node/commit/2678e1423e11fc3af0bfa809db54ebebf12d38fa dated February 22, 2016 - Head: https://github.com/nodejs/node-chakracore/commit/785b5f6134abb2572caa1731bded988c5cb41f00
git tag master-20160222 2678e14
git branch chakracore-20160222 2678e14
git checkout -b chakracore-20160222-staging chakracore-master
git rebase chakracore-20160222
# The conflicts are solved in the PR, we can shortcut:
git checkout 785b5f6 README.md
git rebase --continue
git checkout 785b5f6 lib/repl.js
git rebase --continue
git checkout 785b5f6 test/parallel/test-debug-brk.js test/parallel/test-debug-no-context.js
git rebase --continue
# Then apply the 3 new commits
git cherry-pick e3d86e2..785b5f6
# These 3 new commits should be squashed with the respective original commits to simplify the changes
git rebase -i master-20160222
# Would open PR from chakracore-20160222-staging to chakracore-20160222, land with:
git checkout chakracore-20160222
git merge --ff-only chakracore-20160222-staging
git branch -d chakracore-20160222-staging
git branch -f chakracore-master