mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 23:48:34 +02:00
levle 4 cute
This commit is contained in:
parent
bde5681573
commit
a83a12b211
6 changed files with 185 additions and 45 deletions
102
build/bundle.js
102
build/bundle.js
|
@ -6572,7 +6572,6 @@ var Level = Sandbox.extend({
|
||||||
this.commandsThatCount = this.getCommandsThatCount();
|
this.commandsThatCount = this.getCommandsThatCount();
|
||||||
this.solved = false;
|
this.solved = false;
|
||||||
|
|
||||||
// possible options on how stringent to be on comparisons go here
|
|
||||||
this.treeCompare = new TreeCompare();
|
this.treeCompare = new TreeCompare();
|
||||||
|
|
||||||
this.initGoalData(options);
|
this.initGoalData(options);
|
||||||
|
@ -6685,13 +6684,11 @@ var Level = Sandbox.extend({
|
||||||
showSolution: function(command, deferred) {
|
showSolution: function(command, deferred) {
|
||||||
var confirmDefer = Q.defer();
|
var confirmDefer = Q.defer();
|
||||||
var confirmView = new ConfirmCancelTerminal({
|
var confirmView = new ConfirmCancelTerminal({
|
||||||
modalAlert: {
|
markdowns: [
|
||||||
markdowns: [
|
'## Are you sure you want to see the solution?',
|
||||||
'## Are you sure you want to see the solution?',
|
'',
|
||||||
'',
|
'I believe in you! You can do it'
|
||||||
'I believe in you! You can do it'
|
],
|
||||||
]
|
|
||||||
},
|
|
||||||
deferred: confirmDefer
|
deferred: confirmDefer
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -6811,7 +6808,12 @@ var Level = Sandbox.extend({
|
||||||
|
|
||||||
// ok so lets see if they solved it...
|
// ok so lets see if they solved it...
|
||||||
var current = this.mainVis.gitEngine.exportTree();
|
var current = this.mainVis.gitEngine.exportTree();
|
||||||
var solved = this.treeCompare.compareAllBranchesWithinTreesAndHEAD(current, this.level.goalTreeString);
|
var solved;
|
||||||
|
if (this.level.compareOnlyMaster) {
|
||||||
|
solved = this.treeCompare.compareBranchWithinTrees(current, this.level.goalTreeString, 'master');
|
||||||
|
} else {
|
||||||
|
solved = this.treeCompare.compareAllBranchesWithinTreesAndHEAD(current, this.level.goalTreeString);
|
||||||
|
}
|
||||||
|
|
||||||
if (!solved) {
|
if (!solved) {
|
||||||
defer.resolve();
|
defer.resolve();
|
||||||
|
@ -8258,6 +8260,7 @@ GitEngine.prototype.dateSortFunc = function(cA, cB) {
|
||||||
var dateB = new Date(cB.get('createTime'));
|
var dateB = new Date(cB.get('createTime'));
|
||||||
if (dateA - dateB === 0) {
|
if (dateA - dateB === 0) {
|
||||||
console.warn('WUT it is equal');
|
console.warn('WUT it is equal');
|
||||||
|
console.log(cA, cB);
|
||||||
}
|
}
|
||||||
return dateA - dateB;
|
return dateA - dateB;
|
||||||
};
|
};
|
||||||
|
@ -17068,14 +17071,32 @@ require.define("/src/levels/intro/4.js",function(require,module,exports,__dirnam
|
||||||
});
|
});
|
||||||
|
|
||||||
require.define("/src/levels/rebase/1.js",function(require,module,exports,__dirname,__filename,process,global){exports.level = {
|
require.define("/src/levels/rebase/1.js",function(require,module,exports,__dirname,__filename,process,global){exports.level = {
|
||||||
name: 'Introduction #1',
|
"compareOnlyMaster": true,
|
||||||
description: 'Oh wut?',
|
"goalTreeString": "%7B%22branches%22%3A%7B%22master%22%3A%7B%22target%22%3A%22C7%27%22%2C%22id%22%3A%22master%22%7D%2C%22bugFix%22%3A%7B%22target%22%3A%22C2%27%22%2C%22id%22%3A%22bugFix%22%7D%2C%22side%22%3A%7B%22target%22%3A%22C6%27%22%2C%22id%22%3A%22side%22%7D%2C%22another%22%3A%7B%22target%22%3A%22C7%27%22%2C%22id%22%3A%22another%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%22C1%22%5D%2C%22id%22%3A%22C3%22%7D%2C%22C4%22%3A%7B%22parents%22%3A%5B%22C0%22%5D%2C%22id%22%3A%22C4%22%7D%2C%22C5%22%3A%7B%22parents%22%3A%5B%22C4%22%5D%2C%22id%22%3A%22C5%22%7D%2C%22C6%22%3A%7B%22parents%22%3A%5B%22C5%22%5D%2C%22id%22%3A%22C6%22%7D%2C%22C7%22%3A%7B%22parents%22%3A%5B%22C5%22%5D%2C%22id%22%3A%22C7%22%7D%2C%22C2%27%22%3A%7B%22parents%22%3A%5B%22C3%22%5D%2C%22id%22%3A%22C2%27%22%7D%2C%22C4%27%22%3A%7B%22parents%22%3A%5B%22C2%27%22%5D%2C%22id%22%3A%22C4%27%22%7D%2C%22C5%27%22%3A%7B%22parents%22%3A%5B%22C4%27%22%5D%2C%22id%22%3A%22C5%27%22%7D%2C%22C6%27%22%3A%7B%22parents%22%3A%5B%22C5%27%22%5D%2C%22id%22%3A%22C6%27%22%7D%2C%22C7%27%22%3A%7B%22parents%22%3A%5B%22C6%27%22%5D%2C%22id%22%3A%22C7%27%22%7D%7D%2C%22HEAD%22%3A%7B%22target%22%3A%22master%22%2C%22id%22%3A%22HEAD%22%7D%7D",
|
||||||
goalTreeString: '{"branches":{"master":{"target":"C1","id":"master"},"win":{"target":"C2","id":"win"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"},"C2":{"parents":["C1"],"id":"C2"}},"HEAD":{"target":"win","id":"HEAD"}}',
|
"solutionCommand": "git checkout bugFix;git rebase master;git checkout side;git rebase bugFix;git checkout another;git rebase side;git rebase another master",
|
||||||
solutionCommand: 'git checkout -b win; git commit',
|
"startTree": "{\"branches\":{\"master\":{\"target\":\"C3\",\"id\":\"master\"},\"bugFix\":{\"target\":\"C2\",\"id\":\"bugFix\"},\"side\":{\"target\":\"C6\",\"id\":\"side\"},\"another\":{\"target\":\"C7\",\"id\":\"another\"}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C1\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C0\"],\"id\":\"C4\"},\"C5\":{\"parents\":[\"C4\"],\"id\":\"C5\"},\"C6\":{\"parents\":[\"C5\"],\"id\":\"C6\"},\"C7\":{\"parents\":[\"C5\"],\"id\":\"C7\"}},\"HEAD\":{\"target\":\"another\",\"id\":\"HEAD\"}}",
|
||||||
hint: 'Try checking out a branch named after Charlie Sheen'
|
"name": "Rebasing over 9000 times",
|
||||||
|
"hint": "Remember, the most efficient way might be to only update master at the end...",
|
||||||
|
"startDialog": {
|
||||||
|
"childViews": [
|
||||||
|
{
|
||||||
|
"type": "ModalAlert",
|
||||||
|
"options": {
|
||||||
|
"markdowns": [
|
||||||
|
"### Rebasing Multiple Branches",
|
||||||
|
"",
|
||||||
|
"Man, we have a lot of branches going on here! Let's rebase all the work from these branches onto master.",
|
||||||
|
"",
|
||||||
|
"Upper management is making this a bit trickier though -- they want the commits to all be in sequential order. So this means that our final tree should show `C2`, `C3`, `C4'`, `C5'`, etc all in order.",
|
||||||
|
"",
|
||||||
|
"If you mess up along the way, feel free to use `reset` to start over again. Be sure to check our our solution and see if you can do it in fewer commands!"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
require.define("/src/js/views/levelDropdownView.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
|
require.define("/src/js/views/levelDropdownView.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
|
||||||
|
@ -19404,6 +19425,7 @@ GitEngine.prototype.dateSortFunc = function(cA, cB) {
|
||||||
var dateB = new Date(cB.get('createTime'));
|
var dateB = new Date(cB.get('createTime'));
|
||||||
if (dateA - dateB === 0) {
|
if (dateA - dateB === 0) {
|
||||||
console.warn('WUT it is equal');
|
console.warn('WUT it is equal');
|
||||||
|
console.log(cA, cB);
|
||||||
}
|
}
|
||||||
return dateA - dateB;
|
return dateA - dateB;
|
||||||
};
|
};
|
||||||
|
@ -20968,7 +20990,6 @@ var Level = Sandbox.extend({
|
||||||
this.commandsThatCount = this.getCommandsThatCount();
|
this.commandsThatCount = this.getCommandsThatCount();
|
||||||
this.solved = false;
|
this.solved = false;
|
||||||
|
|
||||||
// possible options on how stringent to be on comparisons go here
|
|
||||||
this.treeCompare = new TreeCompare();
|
this.treeCompare = new TreeCompare();
|
||||||
|
|
||||||
this.initGoalData(options);
|
this.initGoalData(options);
|
||||||
|
@ -21081,13 +21102,11 @@ var Level = Sandbox.extend({
|
||||||
showSolution: function(command, deferred) {
|
showSolution: function(command, deferred) {
|
||||||
var confirmDefer = Q.defer();
|
var confirmDefer = Q.defer();
|
||||||
var confirmView = new ConfirmCancelTerminal({
|
var confirmView = new ConfirmCancelTerminal({
|
||||||
modalAlert: {
|
markdowns: [
|
||||||
markdowns: [
|
'## Are you sure you want to see the solution?',
|
||||||
'## Are you sure you want to see the solution?',
|
'',
|
||||||
'',
|
'I believe in you! You can do it'
|
||||||
'I believe in you! You can do it'
|
],
|
||||||
]
|
|
||||||
},
|
|
||||||
deferred: confirmDefer
|
deferred: confirmDefer
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -21207,7 +21226,12 @@ var Level = Sandbox.extend({
|
||||||
|
|
||||||
// ok so lets see if they solved it...
|
// ok so lets see if they solved it...
|
||||||
var current = this.mainVis.gitEngine.exportTree();
|
var current = this.mainVis.gitEngine.exportTree();
|
||||||
var solved = this.treeCompare.compareAllBranchesWithinTreesAndHEAD(current, this.level.goalTreeString);
|
var solved;
|
||||||
|
if (this.level.compareOnlyMaster) {
|
||||||
|
solved = this.treeCompare.compareBranchWithinTrees(current, this.level.goalTreeString, 'master');
|
||||||
|
} else {
|
||||||
|
solved = this.treeCompare.compareAllBranchesWithinTreesAndHEAD(current, this.level.goalTreeString);
|
||||||
|
}
|
||||||
|
|
||||||
if (!solved) {
|
if (!solved) {
|
||||||
defer.resolve();
|
defer.resolve();
|
||||||
|
@ -27791,14 +27815,32 @@ require.define("/src/levels/intro/4.js",function(require,module,exports,__dirnam
|
||||||
require("/src/levels/intro/4.js");
|
require("/src/levels/intro/4.js");
|
||||||
|
|
||||||
require.define("/src/levels/rebase/1.js",function(require,module,exports,__dirname,__filename,process,global){exports.level = {
|
require.define("/src/levels/rebase/1.js",function(require,module,exports,__dirname,__filename,process,global){exports.level = {
|
||||||
name: 'Introduction #1',
|
"compareOnlyMaster": true,
|
||||||
description: 'Oh wut?',
|
"goalTreeString": "%7B%22branches%22%3A%7B%22master%22%3A%7B%22target%22%3A%22C7%27%22%2C%22id%22%3A%22master%22%7D%2C%22bugFix%22%3A%7B%22target%22%3A%22C2%27%22%2C%22id%22%3A%22bugFix%22%7D%2C%22side%22%3A%7B%22target%22%3A%22C6%27%22%2C%22id%22%3A%22side%22%7D%2C%22another%22%3A%7B%22target%22%3A%22C7%27%22%2C%22id%22%3A%22another%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%22C1%22%5D%2C%22id%22%3A%22C3%22%7D%2C%22C4%22%3A%7B%22parents%22%3A%5B%22C0%22%5D%2C%22id%22%3A%22C4%22%7D%2C%22C5%22%3A%7B%22parents%22%3A%5B%22C4%22%5D%2C%22id%22%3A%22C5%22%7D%2C%22C6%22%3A%7B%22parents%22%3A%5B%22C5%22%5D%2C%22id%22%3A%22C6%22%7D%2C%22C7%22%3A%7B%22parents%22%3A%5B%22C5%22%5D%2C%22id%22%3A%22C7%22%7D%2C%22C2%27%22%3A%7B%22parents%22%3A%5B%22C3%22%5D%2C%22id%22%3A%22C2%27%22%7D%2C%22C4%27%22%3A%7B%22parents%22%3A%5B%22C2%27%22%5D%2C%22id%22%3A%22C4%27%22%7D%2C%22C5%27%22%3A%7B%22parents%22%3A%5B%22C4%27%22%5D%2C%22id%22%3A%22C5%27%22%7D%2C%22C6%27%22%3A%7B%22parents%22%3A%5B%22C5%27%22%5D%2C%22id%22%3A%22C6%27%22%7D%2C%22C7%27%22%3A%7B%22parents%22%3A%5B%22C6%27%22%5D%2C%22id%22%3A%22C7%27%22%7D%7D%2C%22HEAD%22%3A%7B%22target%22%3A%22master%22%2C%22id%22%3A%22HEAD%22%7D%7D",
|
||||||
goalTreeString: '{"branches":{"master":{"target":"C1","id":"master"},"win":{"target":"C2","id":"win"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"},"C2":{"parents":["C1"],"id":"C2"}},"HEAD":{"target":"win","id":"HEAD"}}',
|
"solutionCommand": "git checkout bugFix;git rebase master;git checkout side;git rebase bugFix;git checkout another;git rebase side;git rebase another master",
|
||||||
solutionCommand: 'git checkout -b win; git commit',
|
"startTree": "{\"branches\":{\"master\":{\"target\":\"C3\",\"id\":\"master\"},\"bugFix\":{\"target\":\"C2\",\"id\":\"bugFix\"},\"side\":{\"target\":\"C6\",\"id\":\"side\"},\"another\":{\"target\":\"C7\",\"id\":\"another\"}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C1\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C0\"],\"id\":\"C4\"},\"C5\":{\"parents\":[\"C4\"],\"id\":\"C5\"},\"C6\":{\"parents\":[\"C5\"],\"id\":\"C6\"},\"C7\":{\"parents\":[\"C5\"],\"id\":\"C7\"}},\"HEAD\":{\"target\":\"another\",\"id\":\"HEAD\"}}",
|
||||||
hint: 'Try checking out a branch named after Charlie Sheen'
|
"name": "Rebasing over 9000 times",
|
||||||
|
"hint": "Remember, the most efficient way might be to only update master at the end...",
|
||||||
|
"startDialog": {
|
||||||
|
"childViews": [
|
||||||
|
{
|
||||||
|
"type": "ModalAlert",
|
||||||
|
"options": {
|
||||||
|
"markdowns": [
|
||||||
|
"### Rebasing Multiple Branches",
|
||||||
|
"",
|
||||||
|
"Man, we have a lot of branches going on here! Let's rebase all the work from these branches onto master.",
|
||||||
|
"",
|
||||||
|
"Upper management is making this a bit trickier though -- they want the commits to all be in sequential order. So this means that our final tree should show `C2`, `C3`, `C4'`, `C5'`, etc all in order.",
|
||||||
|
"",
|
||||||
|
"If you mess up along the way, feel free to use `reset` to start over again. Be sure to check our our solution and see if you can do it in fewer commands!"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
require("/src/levels/rebase/1.js");
|
require("/src/levels/rebase/1.js");
|
||||||
|
|
||||||
|
|
|
@ -897,6 +897,7 @@ GitEngine.prototype.dateSortFunc = function(cA, cB) {
|
||||||
var dateB = new Date(cB.get('createTime'));
|
var dateB = new Date(cB.get('createTime'));
|
||||||
if (dateA - dateB === 0) {
|
if (dateA - dateB === 0) {
|
||||||
console.warn('WUT it is equal');
|
console.warn('WUT it is equal');
|
||||||
|
console.log(cA, cB);
|
||||||
}
|
}
|
||||||
return dateA - dateB;
|
return dateA - dateB;
|
||||||
};
|
};
|
||||||
|
|
|
@ -43,7 +43,6 @@ var Level = Sandbox.extend({
|
||||||
this.commandsThatCount = this.getCommandsThatCount();
|
this.commandsThatCount = this.getCommandsThatCount();
|
||||||
this.solved = false;
|
this.solved = false;
|
||||||
|
|
||||||
// possible options on how stringent to be on comparisons go here
|
|
||||||
this.treeCompare = new TreeCompare();
|
this.treeCompare = new TreeCompare();
|
||||||
|
|
||||||
this.initGoalData(options);
|
this.initGoalData(options);
|
||||||
|
@ -156,13 +155,11 @@ var Level = Sandbox.extend({
|
||||||
showSolution: function(command, deferred) {
|
showSolution: function(command, deferred) {
|
||||||
var confirmDefer = Q.defer();
|
var confirmDefer = Q.defer();
|
||||||
var confirmView = new ConfirmCancelTerminal({
|
var confirmView = new ConfirmCancelTerminal({
|
||||||
modalAlert: {
|
markdowns: [
|
||||||
markdowns: [
|
'## Are you sure you want to see the solution?',
|
||||||
'## Are you sure you want to see the solution?',
|
'',
|
||||||
'',
|
'I believe in you! You can do it'
|
||||||
'I believe in you! You can do it'
|
],
|
||||||
]
|
|
||||||
},
|
|
||||||
deferred: confirmDefer
|
deferred: confirmDefer
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -282,7 +279,12 @@ var Level = Sandbox.extend({
|
||||||
|
|
||||||
// ok so lets see if they solved it...
|
// ok so lets see if they solved it...
|
||||||
var current = this.mainVis.gitEngine.exportTree();
|
var current = this.mainVis.gitEngine.exportTree();
|
||||||
var solved = this.treeCompare.compareAllBranchesWithinTreesAndHEAD(current, this.level.goalTreeString);
|
var solved;
|
||||||
|
if (this.level.compareOnlyMaster) {
|
||||||
|
solved = this.treeCompare.compareBranchWithinTrees(current, this.level.goalTreeString, 'master');
|
||||||
|
} else {
|
||||||
|
solved = this.treeCompare.compareAllBranchesWithinTreesAndHEAD(current, this.level.goalTreeString);
|
||||||
|
}
|
||||||
|
|
||||||
if (!solved) {
|
if (!solved) {
|
||||||
defer.resolve();
|
defer.resolve();
|
||||||
|
|
73
src/levels/intro/4.js
Normal file
73
src/levels/intro/4.js
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
exports.level = {
|
||||||
|
"goalTreeString": "%7B%22branches%22%3A%7B%22master%22%3A%7B%22target%22%3A%22C3%22%2C%22id%22%3A%22master%22%7D%2C%22bugFix%22%3A%7B%22target%22%3A%22C2%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%22C1%22%5D%2C%22id%22%3A%22C3%22%7D%2C%22C2%27%22%3A%7B%22parents%22%3A%5B%22C3%22%5D%2C%22id%22%3A%22C2%27%22%7D%7D%2C%22HEAD%22%3A%7B%22target%22%3A%22bugFix%22%2C%22id%22%3A%22HEAD%22%7D%7D",
|
||||||
|
"solutionCommand": "git checkout -b bugFix;git commit;git checkout master;git commit;git checkout bugFix;git rebase master",
|
||||||
|
"name": "Rebase Introduction",
|
||||||
|
"hint": "Make sure you commit from bugFix first",
|
||||||
|
"startDialog": {
|
||||||
|
"childViews": [
|
||||||
|
{
|
||||||
|
"type": "ModalAlert",
|
||||||
|
"options": {
|
||||||
|
"markdowns": [
|
||||||
|
"## Git Rebase",
|
||||||
|
"",
|
||||||
|
"The second way of combining work between branches is *rebasing.* Rebasing essentially takes a set of commits, \"copies\" them, and plops them down somewhere else.",
|
||||||
|
"",
|
||||||
|
"While this sounds confusing, the advantage of rebasing is that it can be used to make a nice linear sequence of commits. The commit log / history of the repository will be a lot cleaner if only rebasing is allowed.",
|
||||||
|
"",
|
||||||
|
"Let's see it in action..."
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "GitDemonstrationView",
|
||||||
|
"options": {
|
||||||
|
"beforeMarkdowns": [
|
||||||
|
"Here we have two branches yet again; note that the bugFix branch is currently selected (note the asterisk)",
|
||||||
|
"",
|
||||||
|
"We would like to move our work from bugFix directly onto the work from master. That way it woud look like these two features were developed sequentially, when in reality they were developed in parallel.",
|
||||||
|
"",
|
||||||
|
"Let's do that with the `git rebase` command"
|
||||||
|
],
|
||||||
|
"afterMarkdowns": [
|
||||||
|
"Awesome! Now the work from our bugFix branch is right on top of master and we have a nice linear sequence of commits.",
|
||||||
|
"",
|
||||||
|
"Note that the commit C3 still exists somewhere (it has a faded appearance in the tree), and C3' is the \"copy\" that we rebased onto master.",
|
||||||
|
"",
|
||||||
|
"The only problem is that master hasn't been updated either, let's do that now..."
|
||||||
|
],
|
||||||
|
"command": "git rebase master",
|
||||||
|
"beforeCommand": "git commit; git checkout -b bugFix C1; git commit"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "GitDemonstrationView",
|
||||||
|
"options": {
|
||||||
|
"beforeMarkdowns": [
|
||||||
|
"Now we are checked out on the `master` branch. Let's do ahead and rebase onto `bugFix`..."
|
||||||
|
],
|
||||||
|
"afterMarkdowns": [
|
||||||
|
"There! Since `master` was downstream of `bugFix`, git simply moved the `master` branch reference forward in history."
|
||||||
|
],
|
||||||
|
"command": "git rebase bugFix",
|
||||||
|
"beforeCommand": "git commit; git checkout -b bugFix C1; git commit; git rebase master; git checkout master"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ModalAlert",
|
||||||
|
"options": {
|
||||||
|
"markdowns": [
|
||||||
|
"To complete this level, do the following",
|
||||||
|
"",
|
||||||
|
"* Checkout a new branch named `bugFix`",
|
||||||
|
"* Commit once",
|
||||||
|
"* Go back to master and commit again",
|
||||||
|
"* Check out bugFix again and rebase onto master",
|
||||||
|
"",
|
||||||
|
"Good luck!"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
|
@ -1,8 +1,26 @@
|
||||||
exports.level = {
|
exports.level = {
|
||||||
name: 'Introduction #1',
|
"compareOnlyMaster": true,
|
||||||
description: 'Oh wut?',
|
"goalTreeString": "%7B%22branches%22%3A%7B%22master%22%3A%7B%22target%22%3A%22C7%27%22%2C%22id%22%3A%22master%22%7D%2C%22bugFix%22%3A%7B%22target%22%3A%22C2%27%22%2C%22id%22%3A%22bugFix%22%7D%2C%22side%22%3A%7B%22target%22%3A%22C6%27%22%2C%22id%22%3A%22side%22%7D%2C%22another%22%3A%7B%22target%22%3A%22C7%27%22%2C%22id%22%3A%22another%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%22C1%22%5D%2C%22id%22%3A%22C3%22%7D%2C%22C4%22%3A%7B%22parents%22%3A%5B%22C0%22%5D%2C%22id%22%3A%22C4%22%7D%2C%22C5%22%3A%7B%22parents%22%3A%5B%22C4%22%5D%2C%22id%22%3A%22C5%22%7D%2C%22C6%22%3A%7B%22parents%22%3A%5B%22C5%22%5D%2C%22id%22%3A%22C6%22%7D%2C%22C7%22%3A%7B%22parents%22%3A%5B%22C5%22%5D%2C%22id%22%3A%22C7%22%7D%2C%22C2%27%22%3A%7B%22parents%22%3A%5B%22C3%22%5D%2C%22id%22%3A%22C2%27%22%7D%2C%22C4%27%22%3A%7B%22parents%22%3A%5B%22C2%27%22%5D%2C%22id%22%3A%22C4%27%22%7D%2C%22C5%27%22%3A%7B%22parents%22%3A%5B%22C4%27%22%5D%2C%22id%22%3A%22C5%27%22%7D%2C%22C6%27%22%3A%7B%22parents%22%3A%5B%22C5%27%22%5D%2C%22id%22%3A%22C6%27%22%7D%2C%22C7%27%22%3A%7B%22parents%22%3A%5B%22C6%27%22%5D%2C%22id%22%3A%22C7%27%22%7D%7D%2C%22HEAD%22%3A%7B%22target%22%3A%22master%22%2C%22id%22%3A%22HEAD%22%7D%7D",
|
||||||
goalTreeString: '{"branches":{"master":{"target":"C1","id":"master"},"win":{"target":"C2","id":"win"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"},"C2":{"parents":["C1"],"id":"C2"}},"HEAD":{"target":"win","id":"HEAD"}}',
|
"solutionCommand": "git checkout bugFix;git rebase master;git checkout side;git rebase bugFix;git checkout another;git rebase side;git rebase another master",
|
||||||
solutionCommand: 'git checkout -b win; git commit',
|
"startTree": "{\"branches\":{\"master\":{\"target\":\"C3\",\"id\":\"master\"},\"bugFix\":{\"target\":\"C2\",\"id\":\"bugFix\"},\"side\":{\"target\":\"C6\",\"id\":\"side\"},\"another\":{\"target\":\"C7\",\"id\":\"another\"}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C1\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C0\"],\"id\":\"C4\"},\"C5\":{\"parents\":[\"C4\"],\"id\":\"C5\"},\"C6\":{\"parents\":[\"C5\"],\"id\":\"C6\"},\"C7\":{\"parents\":[\"C5\"],\"id\":\"C7\"}},\"HEAD\":{\"target\":\"another\",\"id\":\"HEAD\"}}",
|
||||||
hint: 'Try checking out a branch named after Charlie Sheen'
|
"name": "Rebasing over 9000 times",
|
||||||
|
"hint": "Remember, the most efficient way might be to only update master at the end...",
|
||||||
|
"startDialog": {
|
||||||
|
"childViews": [
|
||||||
|
{
|
||||||
|
"type": "ModalAlert",
|
||||||
|
"options": {
|
||||||
|
"markdowns": [
|
||||||
|
"### Rebasing Multiple Branches",
|
||||||
|
"",
|
||||||
|
"Man, we have a lot of branches going on here! Let's rebase all the work from these branches onto master.",
|
||||||
|
"",
|
||||||
|
"Upper management is making this a bit trickier though -- they want the commits to all be in sequential order. So this means that our final tree should show `C2`, `C3`, `C4'`, `C5'`, etc all in order.",
|
||||||
|
"",
|
||||||
|
"If you mess up along the way, feel free to use `reset` to start over again. Be sure to check our our solution and see if you can do it in fewer commands!"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
4
todo.txt
4
todo.txt
|
@ -3,6 +3,10 @@ Big Things
|
||||||
[ ] descriptions for levels?
|
[ ] descriptions for levels?
|
||||||
[ ] import random level JSON
|
[ ] import random level JSON
|
||||||
[ ] export / import tree from JSON
|
[ ] export / import tree from JSON
|
||||||
|
[ ] compare settings for a level!!! integrated into builder...
|
||||||
|
[ ] bug with weird tree string:
|
||||||
|
|
||||||
|
"%7B%22branches%22%3A%7B%22master%22%3A%7B%22target%22%3A%22C7%27%22%2C%22id%22%3A%22master%22%7D%2C%22bugFix%22%3A%7B%22target%22%3A%22C2%27%22%2C%22id%22%3A%22bugFix%22%7D%2C%22side%22%3A%7B%22target%22%3A%22C6%27%22%2C%22id%22%3A%22side%22%7D%2C%22another%22%3A%7B%22target%22%3A%22C7%27%22%2C%22id%22%3A%22another%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%22C1%22%5D%2C%22id%22%3A%22C3%22%7D%2C%22C4%22%3A%7B%22parents%22%3A%5B%22C0%22%5D%2C%22id%22%3A%22C4%22%7D%2C%22C5%22%3A%7B%22parents%22%3A%5B%22C4%22%5D%2C%22id%22%3A%22C5%22%7D%2C%22C6%22%3A%7B%22parents%22%3A%5B%22C5%22%5D%2C%22id%22%3A%22C6%22%7D%2C%22C7%22%3A%7B%22parents%22%3A%5B%22C5%22%5D%2C%22id%22%3A%22C7%22%7D%2C%22C2%27%22%3A%7B%22parents%22%3A%5B%22C3%22%5D%2C%22id%22%3A%22C2%27%22%7D%2C%22C4%27%22%3A%7B%22parents%22%3A%5B%22C2%27%22%5D%2C%22id%22%3A%22C4%27%22%7D%2C%22C5%27%22%3A%7B%22parents%22%3A%5B%22C4%27%22%5D%2C%22id%22%3A%22C5%27%22%7D%2C%22C6%27%22%3A%7B%22parents%22%3A%5B%22C5%27%22%5D%2C%22id%22%3A%22C6%27%22%7D%2C%22C7%27%22%3A%7B%22parents%22%3A%5B%22C6%27%22%5D%2C%22id%22%3A%22C7%27%22%7D%7D%2C%22HEAD%22%3A%7B%22target%22%3A%22master%22%2C%22id%22%3A%22HEAD%22%7D%7D"
|
||||||
|
|
||||||
Medium things:
|
Medium things:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue