[Origin] git pull done wow that was easy

This commit is contained in:
Peter Cottle 2013-05-27 10:56:35 -07:00
parent a24f62420d
commit 29415cb525
7 changed files with 76 additions and 27 deletions

View file

@ -7852,7 +7852,19 @@ GitEngine.prototype.fetch = function() {
this.animationFactory.refreshTree(this.animationQueue, this.gitVisuals);
};
GitEngine.prototype.originInitStarter = function() {
GitEngine.prototype.pullStarter = function() {
this.acceptNoGeneralArgs();
// no matter what fetch
this.fetch();
// then either rebase or merge
if (this.commandOptions['--rebase']) {
this.rebaseFinisher('o/master', 'master');
} else {
this.merge('o/master');
}
};
GitEngine.prototype.cloneStarter = function() {
this.acceptNoGeneralArgs();
this.makeOrigin(this.printTree(this.exportTreeForBranch('master')));
};
@ -8248,16 +8260,17 @@ GitEngine.prototype.rebaseStarter = function() {
}
this.twoArgsImpliedHead(this.generalArgs);
this.rebaseFinisher(this.generalArgs[0], this.generalArgs[1]);
};
var response = this.rebase(this.generalArgs[0], this.generalArgs[1]);
GitEngine.prototype.rebaseFinisher = function(targetSource, currentLocation) {
var response = this.rebase(targetSource, currentLocation);
if (response === undefined) {
// was a fastforward or already up to date. returning now
// will trigger the refresh animation by not adding anything to
// the animation queue
return;
}
this.animationFactory.rebaseAnimation(this.animationQueue, response, this, this.gitVisuals);
};
@ -13387,7 +13400,8 @@ var regexMap = {
'git cherry-pick': /^git +cherry-pick($|\s)/,
'git fakeTeamwork': /^git +fakeTeamwork *?$/,
'git fetch': /^git +fetch *?$/,
'git originInit': /^git +originInit *?$/
'git pull': /^git +pull($|\s)/,
'git clone': /^git +clone *?$/
};
var parse = function(str) {
@ -13474,8 +13488,11 @@ GitOptionParser.prototype.getMasterOptionMap = function() {
},
revert: {},
show: {},
originInit: {},
clone: {},
fetch: {},
pull: {
'--rebase': false
},
fakeTeamwork: {}
};
};
@ -22552,7 +22569,8 @@ var regexMap = {
'git cherry-pick': /^git +cherry-pick($|\s)/,
'git fakeTeamwork': /^git +fakeTeamwork *?$/,
'git fetch': /^git +fetch *?$/,
'git originInit': /^git +originInit *?$/
'git pull': /^git +pull($|\s)/,
'git clone': /^git +clone *?$/
};
var parse = function(str) {
@ -22639,8 +22657,11 @@ GitOptionParser.prototype.getMasterOptionMap = function() {
},
revert: {},
show: {},
originInit: {},
clone: {},
fetch: {},
pull: {
'--rebase': false
},
fakeTeamwork: {}
};
};
@ -23636,7 +23657,19 @@ GitEngine.prototype.fetch = function() {
this.animationFactory.refreshTree(this.animationQueue, this.gitVisuals);
};
GitEngine.prototype.originInitStarter = function() {
GitEngine.prototype.pullStarter = function() {
this.acceptNoGeneralArgs();
// no matter what fetch
this.fetch();
// then either rebase or merge
if (this.commandOptions['--rebase']) {
this.rebaseFinisher('o/master', 'master');
} else {
this.merge('o/master');
}
};
GitEngine.prototype.cloneStarter = function() {
this.acceptNoGeneralArgs();
this.makeOrigin(this.printTree(this.exportTreeForBranch('master')));
};
@ -24032,16 +24065,17 @@ GitEngine.prototype.rebaseStarter = function() {
}
this.twoArgsImpliedHead(this.generalArgs);
this.rebaseFinisher(this.generalArgs[0], this.generalArgs[1]);
};
var response = this.rebase(this.generalArgs[0], this.generalArgs[1]);
GitEngine.prototype.rebaseFinisher = function(targetSource, currentLocation) {
var response = this.rebase(targetSource, currentLocation);
if (response === undefined) {
// was a fastforward or already up to date. returning now
// will trigger the refresh animation by not adding anything to
// the animation queue
return;
}
this.animationFactory.rebaseAnimation(this.animationQueue, response, this, this.gitVisuals);
};

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

View file

@ -426,7 +426,7 @@
For a much easier time perusing the source, see the individual files at:
https://github.com/pcottle/learnGitBranching
-->
<script src="build/bundle.js"></script>
<script src="build/bundle.min.4e79ad6e.js"></script>
<!-- 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

View file

@ -64,7 +64,8 @@ var regexMap = {
'git cherry-pick': /^git +cherry-pick($|\s)/,
'git fakeTeamwork': /^git +fakeTeamwork *?$/,
'git fetch': /^git +fetch *?$/,
'git originInit': /^git +originInit *?$/
'git pull': /^git +pull($|\s)/,
'git clone': /^git +clone *?$/
};
var parse = function(str) {
@ -151,8 +152,11 @@ GitOptionParser.prototype.getMasterOptionMap = function() {
},
revert: {},
show: {},
originInit: {},
clone: {},
fetch: {},
pull: {
'--rebase': false
},
fakeTeamwork: {}
};
};

View file

@ -799,7 +799,19 @@ GitEngine.prototype.fetch = function() {
this.animationFactory.refreshTree(this.animationQueue, this.gitVisuals);
};
GitEngine.prototype.originInitStarter = function() {
GitEngine.prototype.pullStarter = function() {
this.acceptNoGeneralArgs();
// no matter what fetch
this.fetch();
// then either rebase or merge
if (this.commandOptions['--rebase']) {
this.rebaseFinisher('o/master', 'master');
} else {
this.merge('o/master');
}
};
GitEngine.prototype.cloneStarter = function() {
this.acceptNoGeneralArgs();
this.makeOrigin(this.printTree(this.exportTreeForBranch('master')));
};
@ -1195,16 +1207,17 @@ GitEngine.prototype.rebaseStarter = function() {
}
this.twoArgsImpliedHead(this.generalArgs);
this.rebaseFinisher(this.generalArgs[0], this.generalArgs[1]);
};
var response = this.rebase(this.generalArgs[0], this.generalArgs[1]);
GitEngine.prototype.rebaseFinisher = function(targetSource, currentLocation) {
var response = this.rebase(targetSource, currentLocation);
if (response === undefined) {
// was a fastforward or already up to date. returning now
// will trigger the refresh animation by not adding anything to
// the animation queue
return;
}
this.animationFactory.rebaseAnimation(this.animationQueue, response, this, this.gitVisuals);
};

View file

@ -13,16 +13,10 @@ Big Things
Origin things:
~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ] Setup branch model to include:
[-] remote branch it is tracking (points to a remote branch model)
[ ] set checkout -b branch __remoteBranch to track the remote branch
[ ] fix branch -a and branch -r to:
-- show remote branches or all branches
[ ] tree comparison with origin.... sigh
[ ] prototype visual layout (background change + header? maybe...)
[ ] worry about how this affects serialization and tree comparisons. We should be able to still only compare the local copy
[ ] git pull
Medium things:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -45,6 +39,8 @@ Ideas for cleaning
Done things:
(I only started this on Dec 17th 2012 to get a better sense of what was done)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[x] remote branch it is tracking (points to a remote branch model)
[x] fix branch -a and branch -r to: show remote branches or all branches
[x] fix branch -f to not allow moving remote branches?
[x] fix checkout to: if you go to __remoteBranch, it just goes to the commit since its read-only.
[x] is remote (custom getter)