mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 15:38:33 +02:00
fake teamwork done
This commit is contained in:
parent
cbcd489a31
commit
3a23973a9a
7 changed files with 127 additions and 21 deletions
|
@ -5401,6 +5401,14 @@ require.define("/src/js/intl/strings.js",function(require,module,exports,__dirna
|
||||||
'en_US': 'Quick commit. Go Bears!',
|
'en_US': 'Quick commit. Go Bears!',
|
||||||
'zh_CN': '快速提交。上啊月熊!'
|
'zh_CN': '快速提交。上啊月熊!'
|
||||||
},
|
},
|
||||||
|
'git-error-origin-required': {
|
||||||
|
'__desc__': 'One of the error messages for git',
|
||||||
|
'en_US': 'An origin is required for that command'
|
||||||
|
},
|
||||||
|
'git-error-origin-exists': {
|
||||||
|
'__desc__': 'One of the error messages for git',
|
||||||
|
'en_US': 'An origin already exists! You cannot make a new one'
|
||||||
|
},
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
'git-error-branch': {
|
'git-error-branch': {
|
||||||
'__desc__': 'One of the error messages for git',
|
'__desc__': 'One of the error messages for git',
|
||||||
|
@ -7243,7 +7251,7 @@ GitEngine.prototype.instantiateFromTree = function(tree) {
|
||||||
GitEngine.prototype.makeOrigin = function(treeString) {
|
GitEngine.prototype.makeOrigin = function(treeString) {
|
||||||
if (this.hasOrigin()) {
|
if (this.hasOrigin()) {
|
||||||
throw new GitError({
|
throw new GitError({
|
||||||
msg: intl.str('git-error-options')
|
msg: intl.str('git-error-origin-exists')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7473,15 +7481,20 @@ GitEngine.prototype.printBranches = function(branches) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GitEngine.prototype.getUniqueID = function() {
|
||||||
|
var id = this.uniqueId('C');
|
||||||
|
while (this.refs[id]) {
|
||||||
|
id = this.uniqueId('C');
|
||||||
|
}
|
||||||
|
return id;
|
||||||
|
};
|
||||||
|
|
||||||
GitEngine.prototype.makeCommit = function(parents, id, options) {
|
GitEngine.prototype.makeCommit = function(parents, id, options) {
|
||||||
// ok we need to actually manually create commit IDs now because
|
// ok we need to actually manually create commit IDs now because
|
||||||
// people like nikita (thanks for finding this!) could
|
// people like nikita (thanks for finding this!) could
|
||||||
// make branches named C2 before creating the commit C2
|
// make branches named C2 before creating the commit C2
|
||||||
if (!id) {
|
if (!id) {
|
||||||
id = this.uniqueId('C');
|
id = this.getUniqueID();
|
||||||
while (this.refs[id]) {
|
|
||||||
id = this.uniqueId('C');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var commit = new Commit(_.extend({
|
var commit = new Commit(_.extend({
|
||||||
|
@ -7697,6 +7710,27 @@ GitEngine.prototype.cherrypickStarter = function() {
|
||||||
this.animationFactory.rebaseAnimation(this.animationQueue, animationResponse, this, this.gitVisuals);
|
this.animationFactory.rebaseAnimation(this.animationQueue, animationResponse, this, this.gitVisuals);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GitEngine.prototype.fakeTeamworkStarter = function() {
|
||||||
|
if (!this.hasOrigin()) {
|
||||||
|
throw new GitError({
|
||||||
|
msg: intl.str('git-error-origin-required')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var id = this.getUniqueID();
|
||||||
|
// fill refs so it is not grabbed again
|
||||||
|
this.refs[id] = {};
|
||||||
|
|
||||||
|
this.origin.receiveTeamwork(id, this.animationQueue);
|
||||||
|
};
|
||||||
|
|
||||||
|
GitEngine.prototype.receiveTeamwork = function(id, animationQueue) {
|
||||||
|
var newCommit = this.makeCommit([this.getCommitFromRef('HEAD')], id);
|
||||||
|
this.setTargetLocation(this.HEAD, newCommit);
|
||||||
|
|
||||||
|
this.animationFactory.genCommitBirthAnimation(animationQueue, newCommit, this.gitVisuals);
|
||||||
|
};
|
||||||
|
|
||||||
GitEngine.prototype.cherrypick = function(ref) {
|
GitEngine.prototype.cherrypick = function(ref) {
|
||||||
var commit = this.getCommitFromRef(ref);
|
var commit = this.getCommitFromRef(ref);
|
||||||
|
|
||||||
|
@ -13180,6 +13214,7 @@ var regexMap = {
|
||||||
'git show': /^git +show($|\s)/,
|
'git show': /^git +show($|\s)/,
|
||||||
'git status': /^git +status($|\s)/,
|
'git status': /^git +status($|\s)/,
|
||||||
'git cherry-pick': /^git +cherry-pick($|\s)/,
|
'git cherry-pick': /^git +cherry-pick($|\s)/,
|
||||||
|
'git fakeTeamwork': /^git +fakeTeamwork *?$/,
|
||||||
'git originInit': /^git +originInit *?$/
|
'git originInit': /^git +originInit *?$/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13265,7 +13300,8 @@ GitOptionParser.prototype.getMasterOptionMap = function() {
|
||||||
},
|
},
|
||||||
revert: {},
|
revert: {},
|
||||||
show: {},
|
show: {},
|
||||||
originInit: {}
|
originInit: {},
|
||||||
|
fakeTeamwork: {}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22342,6 +22378,7 @@ var regexMap = {
|
||||||
'git show': /^git +show($|\s)/,
|
'git show': /^git +show($|\s)/,
|
||||||
'git status': /^git +status($|\s)/,
|
'git status': /^git +status($|\s)/,
|
||||||
'git cherry-pick': /^git +cherry-pick($|\s)/,
|
'git cherry-pick': /^git +cherry-pick($|\s)/,
|
||||||
|
'git fakeTeamwork': /^git +fakeTeamwork *?$/,
|
||||||
'git originInit': /^git +originInit *?$/
|
'git originInit': /^git +originInit *?$/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22427,7 +22464,8 @@ GitOptionParser.prototype.getMasterOptionMap = function() {
|
||||||
},
|
},
|
||||||
revert: {},
|
revert: {},
|
||||||
show: {},
|
show: {},
|
||||||
originInit: {}
|
originInit: {},
|
||||||
|
fakeTeamwork: {}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22830,7 +22868,7 @@ GitEngine.prototype.instantiateFromTree = function(tree) {
|
||||||
GitEngine.prototype.makeOrigin = function(treeString) {
|
GitEngine.prototype.makeOrigin = function(treeString) {
|
||||||
if (this.hasOrigin()) {
|
if (this.hasOrigin()) {
|
||||||
throw new GitError({
|
throw new GitError({
|
||||||
msg: intl.str('git-error-options')
|
msg: intl.str('git-error-origin-exists')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23060,15 +23098,20 @@ GitEngine.prototype.printBranches = function(branches) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GitEngine.prototype.getUniqueID = function() {
|
||||||
|
var id = this.uniqueId('C');
|
||||||
|
while (this.refs[id]) {
|
||||||
|
id = this.uniqueId('C');
|
||||||
|
}
|
||||||
|
return id;
|
||||||
|
};
|
||||||
|
|
||||||
GitEngine.prototype.makeCommit = function(parents, id, options) {
|
GitEngine.prototype.makeCommit = function(parents, id, options) {
|
||||||
// ok we need to actually manually create commit IDs now because
|
// ok we need to actually manually create commit IDs now because
|
||||||
// people like nikita (thanks for finding this!) could
|
// people like nikita (thanks for finding this!) could
|
||||||
// make branches named C2 before creating the commit C2
|
// make branches named C2 before creating the commit C2
|
||||||
if (!id) {
|
if (!id) {
|
||||||
id = this.uniqueId('C');
|
id = this.getUniqueID();
|
||||||
while (this.refs[id]) {
|
|
||||||
id = this.uniqueId('C');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var commit = new Commit(_.extend({
|
var commit = new Commit(_.extend({
|
||||||
|
@ -23284,6 +23327,27 @@ GitEngine.prototype.cherrypickStarter = function() {
|
||||||
this.animationFactory.rebaseAnimation(this.animationQueue, animationResponse, this, this.gitVisuals);
|
this.animationFactory.rebaseAnimation(this.animationQueue, animationResponse, this, this.gitVisuals);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GitEngine.prototype.fakeTeamworkStarter = function() {
|
||||||
|
if (!this.hasOrigin()) {
|
||||||
|
throw new GitError({
|
||||||
|
msg: intl.str('git-error-origin-required')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var id = this.getUniqueID();
|
||||||
|
// fill refs so it is not grabbed again
|
||||||
|
this.refs[id] = {};
|
||||||
|
|
||||||
|
this.origin.receiveTeamwork(id, this.animationQueue);
|
||||||
|
};
|
||||||
|
|
||||||
|
GitEngine.prototype.receiveTeamwork = function(id, animationQueue) {
|
||||||
|
var newCommit = this.makeCommit([this.getCommitFromRef('HEAD')], id);
|
||||||
|
this.setTargetLocation(this.HEAD, newCommit);
|
||||||
|
|
||||||
|
this.animationFactory.genCommitBirthAnimation(animationQueue, newCommit, this.gitVisuals);
|
||||||
|
};
|
||||||
|
|
||||||
GitEngine.prototype.cherrypick = function(ref) {
|
GitEngine.prototype.cherrypick = function(ref) {
|
||||||
var commit = this.getCommitFromRef(ref);
|
var commit = this.getCommitFromRef(ref);
|
||||||
|
|
||||||
|
@ -25007,6 +25071,14 @@ require.define("/src/js/intl/strings.js",function(require,module,exports,__dirna
|
||||||
'en_US': 'Quick commit. Go Bears!',
|
'en_US': 'Quick commit. Go Bears!',
|
||||||
'zh_CN': '快速提交。上啊月熊!'
|
'zh_CN': '快速提交。上啊月熊!'
|
||||||
},
|
},
|
||||||
|
'git-error-origin-required': {
|
||||||
|
'__desc__': 'One of the error messages for git',
|
||||||
|
'en_US': 'An origin is required for that command'
|
||||||
|
},
|
||||||
|
'git-error-origin-exists': {
|
||||||
|
'__desc__': 'One of the error messages for git',
|
||||||
|
'en_US': 'An origin already exists! You cannot make a new one'
|
||||||
|
},
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
'git-error-branch': {
|
'git-error-branch': {
|
||||||
'__desc__': 'One of the error messages for git',
|
'__desc__': 'One of the error messages for git',
|
||||||
|
|
File diff suppressed because one or more lines are too long
1
build/bundle.min.js
vendored
1
build/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -426,7 +426,7 @@
|
||||||
For a much easier time perusing the source, see the individual files at:
|
For a much easier time perusing the source, see the individual files at:
|
||||||
https://github.com/pcottle/learnGitBranching
|
https://github.com/pcottle/learnGitBranching
|
||||||
-->
|
-->
|
||||||
<script src="build/bundle.min.481e7a58.js"></script>
|
<script src="build/bundle.js"></script>
|
||||||
|
|
||||||
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
|
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
|
||||||
The downside? No raw logs to parse for analytics, so I have to include
|
The downside? No raw logs to parse for analytics, so I have to include
|
||||||
|
|
|
@ -62,6 +62,7 @@ var regexMap = {
|
||||||
'git show': /^git +show($|\s)/,
|
'git show': /^git +show($|\s)/,
|
||||||
'git status': /^git +status($|\s)/,
|
'git status': /^git +status($|\s)/,
|
||||||
'git cherry-pick': /^git +cherry-pick($|\s)/,
|
'git cherry-pick': /^git +cherry-pick($|\s)/,
|
||||||
|
'git fakeTeamwork': /^git +fakeTeamwork *?$/,
|
||||||
'git originInit': /^git +originInit *?$/
|
'git originInit': /^git +originInit *?$/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -147,7 +148,8 @@ GitOptionParser.prototype.getMasterOptionMap = function() {
|
||||||
},
|
},
|
||||||
revert: {},
|
revert: {},
|
||||||
show: {},
|
show: {},
|
||||||
originInit: {}
|
originInit: {},
|
||||||
|
fakeTeamwork: {}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ GitEngine.prototype.instantiateFromTree = function(tree) {
|
||||||
GitEngine.prototype.makeOrigin = function(treeString) {
|
GitEngine.prototype.makeOrigin = function(treeString) {
|
||||||
if (this.hasOrigin()) {
|
if (this.hasOrigin()) {
|
||||||
throw new GitError({
|
throw new GitError({
|
||||||
msg: intl.str('git-error-options')
|
msg: intl.str('git-error-origin-exists')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,15 +437,20 @@ GitEngine.prototype.printBranches = function(branches) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GitEngine.prototype.getUniqueID = function() {
|
||||||
|
var id = this.uniqueId('C');
|
||||||
|
while (this.refs[id]) {
|
||||||
|
id = this.uniqueId('C');
|
||||||
|
}
|
||||||
|
return id;
|
||||||
|
};
|
||||||
|
|
||||||
GitEngine.prototype.makeCommit = function(parents, id, options) {
|
GitEngine.prototype.makeCommit = function(parents, id, options) {
|
||||||
// ok we need to actually manually create commit IDs now because
|
// ok we need to actually manually create commit IDs now because
|
||||||
// people like nikita (thanks for finding this!) could
|
// people like nikita (thanks for finding this!) could
|
||||||
// make branches named C2 before creating the commit C2
|
// make branches named C2 before creating the commit C2
|
||||||
if (!id) {
|
if (!id) {
|
||||||
id = this.uniqueId('C');
|
id = this.getUniqueID();
|
||||||
while (this.refs[id]) {
|
|
||||||
id = this.uniqueId('C');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var commit = new Commit(_.extend({
|
var commit = new Commit(_.extend({
|
||||||
|
@ -661,6 +666,27 @@ GitEngine.prototype.cherrypickStarter = function() {
|
||||||
this.animationFactory.rebaseAnimation(this.animationQueue, animationResponse, this, this.gitVisuals);
|
this.animationFactory.rebaseAnimation(this.animationQueue, animationResponse, this, this.gitVisuals);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GitEngine.prototype.fakeTeamworkStarter = function() {
|
||||||
|
if (!this.hasOrigin()) {
|
||||||
|
throw new GitError({
|
||||||
|
msg: intl.str('git-error-origin-required')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var id = this.getUniqueID();
|
||||||
|
// fill refs so it is not grabbed again
|
||||||
|
this.refs[id] = {};
|
||||||
|
|
||||||
|
this.origin.receiveTeamwork(id, this.animationQueue);
|
||||||
|
};
|
||||||
|
|
||||||
|
GitEngine.prototype.receiveTeamwork = function(id, animationQueue) {
|
||||||
|
var newCommit = this.makeCommit([this.getCommitFromRef('HEAD')], id);
|
||||||
|
this.setTargetLocation(this.HEAD, newCommit);
|
||||||
|
|
||||||
|
this.animationFactory.genCommitBirthAnimation(animationQueue, newCommit, this.gitVisuals);
|
||||||
|
};
|
||||||
|
|
||||||
GitEngine.prototype.cherrypick = function(ref) {
|
GitEngine.prototype.cherrypick = function(ref) {
|
||||||
var commit = this.getCommitFromRef(ref);
|
var commit = this.getCommitFromRef(ref);
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,14 @@ exports.strings = {
|
||||||
'en_US': 'Quick commit. Go Bears!',
|
'en_US': 'Quick commit. Go Bears!',
|
||||||
'zh_CN': '快速提交。上啊月熊!'
|
'zh_CN': '快速提交。上啊月熊!'
|
||||||
},
|
},
|
||||||
|
'git-error-origin-required': {
|
||||||
|
'__desc__': 'One of the error messages for git',
|
||||||
|
'en_US': 'An origin is required for that command'
|
||||||
|
},
|
||||||
|
'git-error-origin-exists': {
|
||||||
|
'__desc__': 'One of the error messages for git',
|
||||||
|
'en_US': 'An origin already exists! You cannot make a new one'
|
||||||
|
},
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
'git-error-branch': {
|
'git-error-branch': {
|
||||||
'__desc__': 'One of the error messages for git',
|
'__desc__': 'One of the error messages for git',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue