mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-12 15:44:25 +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.solved = false;
|
||||
|
||||
// possible options on how stringent to be on comparisons go here
|
||||
this.treeCompare = new TreeCompare();
|
||||
|
||||
this.initGoalData(options);
|
||||
|
@ -6685,13 +6684,11 @@ var Level = Sandbox.extend({
|
|||
showSolution: function(command, deferred) {
|
||||
var confirmDefer = Q.defer();
|
||||
var confirmView = new ConfirmCancelTerminal({
|
||||
modalAlert: {
|
||||
markdowns: [
|
||||
'## Are you sure you want to see the solution?',
|
||||
'',
|
||||
'I believe in you! You can do it'
|
||||
]
|
||||
},
|
||||
markdowns: [
|
||||
'## Are you sure you want to see the solution?',
|
||||
'',
|
||||
'I believe in you! You can do it'
|
||||
],
|
||||
deferred: confirmDefer
|
||||
});
|
||||
|
||||
|
@ -6811,7 +6808,12 @@ var Level = Sandbox.extend({
|
|||
|
||||
// ok so lets see if they solved it...
|
||||
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) {
|
||||
defer.resolve();
|
||||
|
@ -8258,6 +8260,7 @@ GitEngine.prototype.dateSortFunc = function(cA, cB) {
|
|||
var dateB = new Date(cB.get('createTime'));
|
||||
if (dateA - dateB === 0) {
|
||||
console.warn('WUT it is equal');
|
||||
console.log(cA, cB);
|
||||
}
|
||||
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 = {
|
||||
name: 'Introduction #1',
|
||||
description: 'Oh wut?',
|
||||
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 -b win; git commit',
|
||||
hint: 'Try checking out a branch named after Charlie Sheen'
|
||||
"compareOnlyMaster": true,
|
||||
"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",
|
||||
"solutionCommand": "git checkout bugFix;git rebase master;git checkout side;git rebase bugFix;git checkout another;git rebase side;git rebase another master",
|
||||
"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\"}}",
|
||||
"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');
|
||||
|
@ -19404,6 +19425,7 @@ GitEngine.prototype.dateSortFunc = function(cA, cB) {
|
|||
var dateB = new Date(cB.get('createTime'));
|
||||
if (dateA - dateB === 0) {
|
||||
console.warn('WUT it is equal');
|
||||
console.log(cA, cB);
|
||||
}
|
||||
return dateA - dateB;
|
||||
};
|
||||
|
@ -20968,7 +20990,6 @@ var Level = Sandbox.extend({
|
|||
this.commandsThatCount = this.getCommandsThatCount();
|
||||
this.solved = false;
|
||||
|
||||
// possible options on how stringent to be on comparisons go here
|
||||
this.treeCompare = new TreeCompare();
|
||||
|
||||
this.initGoalData(options);
|
||||
|
@ -21081,13 +21102,11 @@ var Level = Sandbox.extend({
|
|||
showSolution: function(command, deferred) {
|
||||
var confirmDefer = Q.defer();
|
||||
var confirmView = new ConfirmCancelTerminal({
|
||||
modalAlert: {
|
||||
markdowns: [
|
||||
'## Are you sure you want to see the solution?',
|
||||
'',
|
||||
'I believe in you! You can do it'
|
||||
]
|
||||
},
|
||||
markdowns: [
|
||||
'## Are you sure you want to see the solution?',
|
||||
'',
|
||||
'I believe in you! You can do it'
|
||||
],
|
||||
deferred: confirmDefer
|
||||
});
|
||||
|
||||
|
@ -21207,7 +21226,12 @@ var Level = Sandbox.extend({
|
|||
|
||||
// ok so lets see if they solved it...
|
||||
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) {
|
||||
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.define("/src/levels/rebase/1.js",function(require,module,exports,__dirname,__filename,process,global){exports.level = {
|
||||
name: 'Introduction #1',
|
||||
description: 'Oh wut?',
|
||||
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 -b win; git commit',
|
||||
hint: 'Try checking out a branch named after Charlie Sheen'
|
||||
"compareOnlyMaster": true,
|
||||
"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",
|
||||
"solutionCommand": "git checkout bugFix;git rebase master;git checkout side;git rebase bugFix;git checkout another;git rebase side;git rebase another master",
|
||||
"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\"}}",
|
||||
"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");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue