diff --git a/build/bundle.js b/build/bundle.js index c6269035..6ac3d51d 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -16771,6 +16771,10 @@ exports.sequenceInfo = { rebase: { displayName: 'Master the Rebase Luke!', about: 'What is this whole rebase hotness everyone is talking about? Find out!' + }, + mixed: { + displayName: 'A Mixed Bag', + about: 'A mixed bag of Git techniques, tricks, and tips' } }; @@ -27586,6 +27590,10 @@ exports.sequenceInfo = { rebase: { displayName: 'Master the Rebase Luke!', about: 'What is this whole rebase hotness everyone is talking about? Find out!' + }, + mixed: { + displayName: 'A Mixed Bag', + about: 'A mixed bag of Git techniques, tricks, and tips' } }; diff --git a/src/levels/index.js b/src/levels/index.js index 3c248c4b..8fa03d8a 100644 --- a/src/levels/index.js +++ b/src/levels/index.js @@ -10,6 +10,9 @@ exports.levelSequences = { ], rebase: [ require('../../levels/rebase/1').level + ], + mixed: [ + require('../../levels/mixed/1').level ] }; @@ -22,6 +25,10 @@ exports.sequenceInfo = { rebase: { displayName: 'Master the Rebase Luke!', about: 'What is this whole rebase hotness everyone is talking about? Find out!' + }, + mixed: { + displayName: 'A Mixed Bag', + about: 'A mixed bag of Git techniques, tricks, and tips' } }; diff --git a/src/levels/mixed/1.js b/src/levels/mixed/1.js new file mode 100644 index 00000000..29fa92f7 --- /dev/null +++ b/src/levels/mixed/1.js @@ -0,0 +1,65 @@ +exports.level = { + "compareOnlyMaster": true, + "goalTreeString": "%7B%22branches%22%3A%7B%22master%22%3A%7B%22target%22%3A%22C4%27%22%2C%22id%22%3A%22master%22%7D%2C%22debug%22%3A%7B%22target%22%3A%22C2%22%2C%22id%22%3A%22debug%22%7D%2C%22printf%22%3A%7B%22target%22%3A%22C3%22%2C%22id%22%3A%22printf%22%7D%2C%22bugFix%22%3A%7B%22target%22%3A%22C4%27%22%2C%22id%22%3A%22bugFix%22%7D%7D%2C%22commits%22%3A%7B%22C0%22%3A%7B%22parents%22%3A%5B%5D%2C%22id%22%3A%22C0%22%2C%22rootCommit%22%3Atrue%7D%2C%22C1%22%3A%7B%22parents%22%3A%5B%22C0%22%5D%2C%22id%22%3A%22C1%22%7D%2C%22C2%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C2%22%7D%2C%22C3%22%3A%7B%22parents%22%3A%5B%22C2%22%5D%2C%22id%22%3A%22C3%22%7D%2C%22C4%22%3A%7B%22parents%22%3A%5B%22C3%22%5D%2C%22id%22%3A%22C4%22%7D%2C%22C4%27%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C4%27%22%7D%7D%2C%22HEAD%22%3A%7B%22target%22%3A%22master%22%2C%22id%22%3A%22HEAD%22%7D%7D", + "solutionCommand": "git cherry-pick C4 master;git checkout master;git cherry-pick C4;git branch -f bugFix C4'", + "startTree": "{\"branches\":{\"master\":{\"target\":\"C1\",\"id\":\"master\"},\"debug\":{\"target\":\"C2\",\"id\":\"debug\"},\"printf\":{\"target\":\"C3\",\"id\":\"printf\"},\"bugFix\":{\"target\":\"C4\",\"id\":\"bugFix\"}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C2\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C3\"],\"id\":\"C4\"}},\"HEAD\":{\"target\":\"bugFix\",\"id\":\"HEAD\"}}", + "name": "Remember, interactive rebasing or cherry-picking is your friend here", + "hint": "Remember, interactive rebase or cherry-pick is your friend here", + "startDialog": { + "childViews": [ + { + "type": "ModalAlert", + "options": { + "markdowns": [ + "## Locally stacked commits", + "", + "Here's a development situation that often happens: I'm trying to track down a bug but it is quite elusive. In order to aid in my detective work, I put in a few debug commands and a few print statements.", + "", + "All of these debugging / print statements are in their own branches. Finally I track down the bug, fix it, and rejoice!", + "", + "Only problem is that I now need to get my `bugFix` back into the `master` branch! I could simply fast-forward `master`, but then `master` would get all my debug statements." + ] + } + }, + { + "type": "ModalAlert", + "options": { + "markdowns": [ + "This is where the magic of Git comes in. There are a few ways to do this, but the two most straightforward are:", + "", + "* `git rebase -i`", + "* `git cherry-pick`", + "", + "Interactive (the `-i`) rebasing allows you to chose which commits you want to keep or discard. It also allows you to reorder commits. This can be helpful if you want to toss out some work.", + "", + "Cherry-picking allows you to pick individual commits and plop them down on top of `HEAD`" + ] + } + }, + { + "type": "GitDemonstrationView", + "options": { + "beforeMarkdowns": [ + "" + ], + "afterMarkdowns": [ + "## Enter some markdown!", + "", + "", + "" + ], + "command": "git commit", + "beforeCommand": "git checkout -b bugFix" + } + }, + { + "type": "ModalAlert", + "options": { + "markdowns": [ + "This is a later level so we will leave it up to you to decide, but in order to complete the level, make sure `master` receives the commit that `bugFix` references." + ] + } + } + ] + } +};