awesome, git fetch working super well

This commit is contained in:
Peter Cottle 2013-06-10 20:21:50 -07:00
parent d18633c608
commit b090cef461
8 changed files with 1230 additions and 37 deletions

View file

@ -5401,6 +5401,10 @@ 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-fetch-uptodate': {
'__desc__': 'One of the error messages for git',
'en_US': 'Already up to date!'
},
'git-error-origin-fetch-no-ff': { 'git-error-origin-fetch-no-ff': {
'__desc__': 'One of the error messages for git', '__desc__': 'One of the error messages for git',
'en_US': 'Your origin branch is out of sync with the remote branch and fetch cannot be performed. try using --force' 'en_US': 'Your origin branch is out of sync with the remote branch and fetch cannot be performed. try using --force'
@ -7812,17 +7816,19 @@ GitEngine.prototype.getTargetGraphDifference = function(
var sourceTree = source.exportTree(); var sourceTree = source.exportTree();
var sourceStartCommitJSON = sourceTree.commits[sourceStartCommit.get('id')]; var sourceStartCommitJSON = sourceTree.commits[sourceStartCommit.get('id')];
if (this.refs[sourceStartCommitJSON.id]) {
throw new GitError({
msg: intl.str('git-error-origin-fetch-uptodate')
});
}
// ok great, we have our starting point and our stopping set. lets go ahead // ok great, we have our starting point and our stopping set. lets go ahead
// and traverse upwards and keep track of depth manually // and traverse upwards and keep track of depth manually
sourceStartCommitJSON.depth = 0; sourceStartCommitJSON.depth = 0;
var difference = []; var difference = [];
var toExplore = [sourceStartCommitJSON]; var toExplore = [sourceStartCommitJSON];
while (toExplore.length) { var pushParent = function(parentID) {
var here = toExplore.pop();
difference.push(here);
_.each(here.parents, function(parentID) {
if (targetSet[parentID]) { if (targetSet[parentID]) {
// we already have this commit, lets bounce // we already have this commit, lets bounce
return; return;
@ -7831,8 +7837,14 @@ GitEngine.prototype.getTargetGraphDifference = function(
var parentJSON = sourceTree.commits[parentID]; var parentJSON = sourceTree.commits[parentID];
parentJSON.depth = here.depth + 1; parentJSON.depth = here.depth + 1;
toExplore.push(parentJSON); toExplore.push(parentJSON);
}, this); };
while (toExplore.length) {
var here = toExplore.pop();
difference.push(here);
_.each(here.parents, pushParent);
} }
return difference.sort(function(cA, cB) { return difference.sort(function(cA, cB) {
// reverse sort by depth // reverse sort by depth
return cB.depth - cA.depth; return cB.depth - cA.depth;
@ -7882,18 +7894,27 @@ GitEngine.prototype.fetch = function() {
var chain = deferred.promise; var chain = deferred.promise;
_.each(commitsToMake, function(commitJSON) { _.each(commitsToMake, function(commitJSON) {
chain = chain.then(_.bind(function() {
return AnimationFactory.playHighlightPromiseAnimation(
this.origin.refs[commitJSON.id],
localBranch
);
}, this));
chain = chain.then(function() { chain = chain.then(function() {
return chainStep( return chainStep(
commitJSON.id, commitJSON.id,
commitJSON.parents commitJSON.parents
); );
}); });
}); }, this);
chain = chain.then(_.bind(function() { chain = chain.then(_.bind(function() {
var originLocationID = remoteBranch.get('target').get('id'); var originLocationID = remoteBranch.get('target').get('id');
var localCommit = this.refs[originLocationID]; var localCommit = this.refs[originLocationID];
this.setTargetLocation(localBranch, localCommit); this.setTargetLocation(localBranch, localCommit);
// unhighlight origin
AnimationFactory.playRefreshAnimation(this.origin.gitVisuals);
return AnimationFactory.playRefreshAnimation(this.gitVisuals); return AnimationFactory.playRefreshAnimation(this.gitVisuals);
}, this)); }, this));
@ -16218,6 +16239,7 @@ var VisNode = VisBase.extend({
circle: { circle: {
fill: color, fill: color,
stroke: color, stroke: color,
'stroke-dasharray': '',
'stroke-width': this.get('stroke-width') * 5 'stroke-width': this.get('stroke-width') * 5
}, },
text: {} text: {}
@ -23719,17 +23741,19 @@ GitEngine.prototype.getTargetGraphDifference = function(
var sourceTree = source.exportTree(); var sourceTree = source.exportTree();
var sourceStartCommitJSON = sourceTree.commits[sourceStartCommit.get('id')]; var sourceStartCommitJSON = sourceTree.commits[sourceStartCommit.get('id')];
if (this.refs[sourceStartCommitJSON.id]) {
throw new GitError({
msg: intl.str('git-error-origin-fetch-uptodate')
});
}
// ok great, we have our starting point and our stopping set. lets go ahead // ok great, we have our starting point and our stopping set. lets go ahead
// and traverse upwards and keep track of depth manually // and traverse upwards and keep track of depth manually
sourceStartCommitJSON.depth = 0; sourceStartCommitJSON.depth = 0;
var difference = []; var difference = [];
var toExplore = [sourceStartCommitJSON]; var toExplore = [sourceStartCommitJSON];
while (toExplore.length) { var pushParent = function(parentID) {
var here = toExplore.pop();
difference.push(here);
_.each(here.parents, function(parentID) {
if (targetSet[parentID]) { if (targetSet[parentID]) {
// we already have this commit, lets bounce // we already have this commit, lets bounce
return; return;
@ -23738,8 +23762,14 @@ GitEngine.prototype.getTargetGraphDifference = function(
var parentJSON = sourceTree.commits[parentID]; var parentJSON = sourceTree.commits[parentID];
parentJSON.depth = here.depth + 1; parentJSON.depth = here.depth + 1;
toExplore.push(parentJSON); toExplore.push(parentJSON);
}, this); };
while (toExplore.length) {
var here = toExplore.pop();
difference.push(here);
_.each(here.parents, pushParent);
} }
return difference.sort(function(cA, cB) { return difference.sort(function(cA, cB) {
// reverse sort by depth // reverse sort by depth
return cB.depth - cA.depth; return cB.depth - cA.depth;
@ -23789,18 +23819,27 @@ GitEngine.prototype.fetch = function() {
var chain = deferred.promise; var chain = deferred.promise;
_.each(commitsToMake, function(commitJSON) { _.each(commitsToMake, function(commitJSON) {
chain = chain.then(_.bind(function() {
return AnimationFactory.playHighlightPromiseAnimation(
this.origin.refs[commitJSON.id],
localBranch
);
}, this));
chain = chain.then(function() { chain = chain.then(function() {
return chainStep( return chainStep(
commitJSON.id, commitJSON.id,
commitJSON.parents commitJSON.parents
); );
}); });
}); }, this);
chain = chain.then(_.bind(function() { chain = chain.then(_.bind(function() {
var originLocationID = remoteBranch.get('target').get('id'); var originLocationID = remoteBranch.get('target').get('id');
var localCommit = this.refs[originLocationID]; var localCommit = this.refs[originLocationID];
this.setTargetLocation(localBranch, localCommit); this.setTargetLocation(localBranch, localCommit);
// unhighlight origin
AnimationFactory.playRefreshAnimation(this.origin.gitVisuals);
return AnimationFactory.playRefreshAnimation(this.gitVisuals); return AnimationFactory.playRefreshAnimation(this.gitVisuals);
}, this)); }, this));
@ -25636,6 +25675,10 @@ 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-fetch-uptodate': {
'__desc__': 'One of the error messages for git',
'en_US': 'Already up to date!'
},
'git-error-origin-fetch-no-ff': { 'git-error-origin-fetch-no-ff': {
'__desc__': 'One of the error messages for git', '__desc__': 'One of the error messages for git',
'en_US': 'Your origin branch is out of sync with the remote branch and fetch cannot be performed. try using --force' 'en_US': 'Your origin branch is out of sync with the remote branch and fetch cannot be performed. try using --force'
@ -33428,6 +33471,7 @@ var VisNode = VisBase.extend({
circle: { circle: {
fill: color, fill: color,
stroke: color, stroke: color,
'stroke-dasharray': '',
'stroke-width': this.get('stroke-width') * 5 'stroke-width': this.get('stroke-width') * 5
}, },
text: {} text: {}

File diff suppressed because one or more lines are too long

1
build/bundle.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1125
build/main.80cc7f4d.css Normal file

File diff suppressed because it is too large Load diff

View file

@ -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.js"></script> <script src="build/bundle.min.774546c0.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

View file

@ -774,17 +774,19 @@ GitEngine.prototype.getTargetGraphDifference = function(
var sourceTree = source.exportTree(); var sourceTree = source.exportTree();
var sourceStartCommitJSON = sourceTree.commits[sourceStartCommit.get('id')]; var sourceStartCommitJSON = sourceTree.commits[sourceStartCommit.get('id')];
if (this.refs[sourceStartCommitJSON.id]) {
throw new GitError({
msg: intl.str('git-error-origin-fetch-uptodate')
});
}
// ok great, we have our starting point and our stopping set. lets go ahead // ok great, we have our starting point and our stopping set. lets go ahead
// and traverse upwards and keep track of depth manually // and traverse upwards and keep track of depth manually
sourceStartCommitJSON.depth = 0; sourceStartCommitJSON.depth = 0;
var difference = []; var difference = [];
var toExplore = [sourceStartCommitJSON]; var toExplore = [sourceStartCommitJSON];
while (toExplore.length) { var pushParent = function(parentID) {
var here = toExplore.pop();
difference.push(here);
_.each(here.parents, function(parentID) {
if (targetSet[parentID]) { if (targetSet[parentID]) {
// we already have this commit, lets bounce // we already have this commit, lets bounce
return; return;
@ -793,8 +795,14 @@ GitEngine.prototype.getTargetGraphDifference = function(
var parentJSON = sourceTree.commits[parentID]; var parentJSON = sourceTree.commits[parentID];
parentJSON.depth = here.depth + 1; parentJSON.depth = here.depth + 1;
toExplore.push(parentJSON); toExplore.push(parentJSON);
}, this); };
while (toExplore.length) {
var here = toExplore.pop();
difference.push(here);
_.each(here.parents, pushParent);
} }
return difference.sort(function(cA, cB) { return difference.sort(function(cA, cB) {
// reverse sort by depth // reverse sort by depth
return cB.depth - cA.depth; return cB.depth - cA.depth;
@ -844,18 +852,27 @@ GitEngine.prototype.fetch = function() {
var chain = deferred.promise; var chain = deferred.promise;
_.each(commitsToMake, function(commitJSON) { _.each(commitsToMake, function(commitJSON) {
chain = chain.then(_.bind(function() {
return AnimationFactory.playHighlightPromiseAnimation(
this.origin.refs[commitJSON.id],
localBranch
);
}, this));
chain = chain.then(function() { chain = chain.then(function() {
return chainStep( return chainStep(
commitJSON.id, commitJSON.id,
commitJSON.parents commitJSON.parents
); );
}); });
}); }, this);
chain = chain.then(_.bind(function() { chain = chain.then(_.bind(function() {
var originLocationID = remoteBranch.get('target').get('id'); var originLocationID = remoteBranch.get('target').get('id');
var localCommit = this.refs[originLocationID]; var localCommit = this.refs[originLocationID];
this.setTargetLocation(localBranch, localCommit); this.setTargetLocation(localBranch, localCommit);
// unhighlight origin
AnimationFactory.playRefreshAnimation(this.origin.gitVisuals);
return AnimationFactory.playRefreshAnimation(this.gitVisuals); return AnimationFactory.playRefreshAnimation(this.gitVisuals);
}, this)); }, this));

View file

@ -52,6 +52,10 @@ exports.strings = {
'en_US': 'Quick commit. Go Bears!', 'en_US': 'Quick commit. Go Bears!',
'zh_CN': '快速提交。上啊月熊!' 'zh_CN': '快速提交。上啊月熊!'
}, },
'git-error-origin-fetch-uptodate': {
'__desc__': 'One of the error messages for git',
'en_US': 'Already up to date!'
},
'git-error-origin-fetch-no-ff': { 'git-error-origin-fetch-no-ff': {
'__desc__': 'One of the error messages for git', '__desc__': 'One of the error messages for git',
'en_US': 'Your origin branch is out of sync with the remote branch and fetch cannot be performed. try using --force' 'en_US': 'Your origin branch is out of sync with the remote branch and fetch cannot be performed. try using --force'

View file

@ -138,6 +138,7 @@ var VisNode = VisBase.extend({
circle: { circle: {
fill: color, fill: color,
stroke: color, stroke: color,
'stroke-dasharray': '',
'stroke-width': this.get('stroke-width') * 5 'stroke-width': this.get('stroke-width') * 5
}, },
text: {} text: {}