mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 16:08:34 +02:00
git pull --rebase now done
This commit is contained in:
parent
69e6cc0472
commit
bbfb4d7512
6 changed files with 168 additions and 24 deletions
124
build/bundle.js
124
build/bundle.js
|
@ -8042,12 +8042,50 @@ GitEngine.prototype.pull = function() {
|
||||||
});
|
});
|
||||||
// then either rebase or merge
|
// then either rebase or merge
|
||||||
if (this.commandOptions['--rebase']) {
|
if (this.commandOptions['--rebase']) {
|
||||||
this.rebase('o/master', 'master');
|
this.pullFinishWithRebase(pendingFetch, localBranch, remoteBranch);
|
||||||
} else {
|
} else {
|
||||||
this.pullFinishWithMerge(pendingFetch, localBranch, remoteBranch);
|
this.pullFinishWithMerge(pendingFetch, localBranch, remoteBranch);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GitEngine.prototype.pullFinishWithRebase = function(
|
||||||
|
pendingFetch,
|
||||||
|
localBranch,
|
||||||
|
remoteBranch
|
||||||
|
) {
|
||||||
|
var chain = pendingFetch.chain;
|
||||||
|
var deferred = pendingFetch.deferred;
|
||||||
|
|
||||||
|
// delay a bit after the intense refresh animation from
|
||||||
|
// fetch
|
||||||
|
chain = chain.then(function() {
|
||||||
|
return AnimationFactory.getDelayedPromise(300);
|
||||||
|
});
|
||||||
|
|
||||||
|
chain = chain.then(_.bind(function() {
|
||||||
|
// highlight last commit on o/master to color of
|
||||||
|
// local branch
|
||||||
|
return AnimationFactory.playHighlightPromiseAnimation(
|
||||||
|
this.getCommitFromRef(remoteBranch),
|
||||||
|
localBranch
|
||||||
|
);
|
||||||
|
}, this));
|
||||||
|
|
||||||
|
chain = chain.then(_.bind(function() {
|
||||||
|
pendingFetch.dontResolvePromise = true;
|
||||||
|
return this.rebase(remoteBranch, localBranch, pendingFetch);
|
||||||
|
}, this));
|
||||||
|
|
||||||
|
chain = chain.then(_.bind(function() {
|
||||||
|
// HAX
|
||||||
|
var localCommit = localBranch.get('target');
|
||||||
|
this.setTargetLocation(this.refs['o/master'], localCommit);
|
||||||
|
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
||||||
|
}, this));
|
||||||
|
|
||||||
|
this.animationQueue.thenFinish(chain, deferred);
|
||||||
|
};
|
||||||
|
|
||||||
GitEngine.prototype.pullFinishWithMerge = function(
|
GitEngine.prototype.pullFinishWithMerge = function(
|
||||||
pendingFetch,
|
pendingFetch,
|
||||||
localBranch,
|
localBranch,
|
||||||
|
@ -8527,7 +8565,7 @@ GitEngine.prototype.rebaseStarter = function() {
|
||||||
this.rebase(this.generalArgs[0], this.generalArgs[1]);
|
this.rebase(this.generalArgs[0], this.generalArgs[1]);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.rebase = function(targetSource, currentLocation) {
|
GitEngine.prototype.rebase = function(targetSource, currentLocation, options) {
|
||||||
// first some conditions
|
// first some conditions
|
||||||
if (this.isUpstreamOf(targetSource, currentLocation)) {
|
if (this.isUpstreamOf(targetSource, currentLocation)) {
|
||||||
this.command.setResult(intl.str('git-result-uptodate'));
|
this.command.setResult(intl.str('git-result-uptodate'));
|
||||||
|
@ -8578,7 +8616,7 @@ GitEngine.prototype.rebase = function(targetSource, currentLocation) {
|
||||||
pQueue = pQueue.concat(popped.get('parents'));
|
pQueue = pQueue.concat(popped.get('parents'));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.rebaseFinish(toRebaseRough, stopSet, targetSource, currentLocation);
|
return this.rebaseFinish(toRebaseRough, stopSet, targetSource, currentLocation, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.rebaseInteractive = function(targetSource, currentLocation) {
|
GitEngine.prototype.rebaseInteractive = function(targetSource, currentLocation) {
|
||||||
|
@ -8688,11 +8726,18 @@ GitEngine.prototype.filterRebaseCommits = function(toRebaseRough, stopSet) {
|
||||||
}, this);
|
}, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.rebaseFinish = function(toRebaseRough, stopSet, targetSource, currentLocation) {
|
GitEngine.prototype.rebaseFinish = function(
|
||||||
|
toRebaseRough,
|
||||||
|
stopSet,
|
||||||
|
targetSource,
|
||||||
|
currentLocation,
|
||||||
|
options
|
||||||
|
) {
|
||||||
|
options = options || {};
|
||||||
// now we have the all the commits between currentLocation and the set of target to rebase.
|
// now we have the all the commits between currentLocation and the set of target to rebase.
|
||||||
var destinationBranch = this.resolveID(targetSource);
|
var destinationBranch = this.resolveID(targetSource);
|
||||||
var deferred = Q.defer();
|
var deferred = options.deferred || Q.defer();
|
||||||
var chain = deferred.promise;
|
var chain = options.chain || deferred.promise;
|
||||||
|
|
||||||
var toRebase = this.filterRebaseCommits(toRebaseRough, stopSet);
|
var toRebase = this.filterRebaseCommits(toRebaseRough, stopSet);
|
||||||
if (!toRebase.length) {
|
if (!toRebase.length) {
|
||||||
|
@ -8741,7 +8786,10 @@ GitEngine.prototype.rebaseFinish = function(toRebaseRough, stopSet, targetSource
|
||||||
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
this.animationQueue.thenFinish(chain, deferred);
|
if (!options.dontResolvePromise) {
|
||||||
|
this.animationQueue.thenFinish(chain, deferred);
|
||||||
|
}
|
||||||
|
return chain;
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.mergeStarter = function() {
|
GitEngine.prototype.mergeStarter = function() {
|
||||||
|
@ -24134,12 +24182,50 @@ GitEngine.prototype.pull = function() {
|
||||||
});
|
});
|
||||||
// then either rebase or merge
|
// then either rebase or merge
|
||||||
if (this.commandOptions['--rebase']) {
|
if (this.commandOptions['--rebase']) {
|
||||||
this.rebase('o/master', 'master');
|
this.pullFinishWithRebase(pendingFetch, localBranch, remoteBranch);
|
||||||
} else {
|
} else {
|
||||||
this.pullFinishWithMerge(pendingFetch, localBranch, remoteBranch);
|
this.pullFinishWithMerge(pendingFetch, localBranch, remoteBranch);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GitEngine.prototype.pullFinishWithRebase = function(
|
||||||
|
pendingFetch,
|
||||||
|
localBranch,
|
||||||
|
remoteBranch
|
||||||
|
) {
|
||||||
|
var chain = pendingFetch.chain;
|
||||||
|
var deferred = pendingFetch.deferred;
|
||||||
|
|
||||||
|
// delay a bit after the intense refresh animation from
|
||||||
|
// fetch
|
||||||
|
chain = chain.then(function() {
|
||||||
|
return AnimationFactory.getDelayedPromise(300);
|
||||||
|
});
|
||||||
|
|
||||||
|
chain = chain.then(_.bind(function() {
|
||||||
|
// highlight last commit on o/master to color of
|
||||||
|
// local branch
|
||||||
|
return AnimationFactory.playHighlightPromiseAnimation(
|
||||||
|
this.getCommitFromRef(remoteBranch),
|
||||||
|
localBranch
|
||||||
|
);
|
||||||
|
}, this));
|
||||||
|
|
||||||
|
chain = chain.then(_.bind(function() {
|
||||||
|
pendingFetch.dontResolvePromise = true;
|
||||||
|
return this.rebase(remoteBranch, localBranch, pendingFetch);
|
||||||
|
}, this));
|
||||||
|
|
||||||
|
chain = chain.then(_.bind(function() {
|
||||||
|
// HAX
|
||||||
|
var localCommit = localBranch.get('target');
|
||||||
|
this.setTargetLocation(this.refs['o/master'], localCommit);
|
||||||
|
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
||||||
|
}, this));
|
||||||
|
|
||||||
|
this.animationQueue.thenFinish(chain, deferred);
|
||||||
|
};
|
||||||
|
|
||||||
GitEngine.prototype.pullFinishWithMerge = function(
|
GitEngine.prototype.pullFinishWithMerge = function(
|
||||||
pendingFetch,
|
pendingFetch,
|
||||||
localBranch,
|
localBranch,
|
||||||
|
@ -24619,7 +24705,7 @@ GitEngine.prototype.rebaseStarter = function() {
|
||||||
this.rebase(this.generalArgs[0], this.generalArgs[1]);
|
this.rebase(this.generalArgs[0], this.generalArgs[1]);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.rebase = function(targetSource, currentLocation) {
|
GitEngine.prototype.rebase = function(targetSource, currentLocation, options) {
|
||||||
// first some conditions
|
// first some conditions
|
||||||
if (this.isUpstreamOf(targetSource, currentLocation)) {
|
if (this.isUpstreamOf(targetSource, currentLocation)) {
|
||||||
this.command.setResult(intl.str('git-result-uptodate'));
|
this.command.setResult(intl.str('git-result-uptodate'));
|
||||||
|
@ -24670,7 +24756,7 @@ GitEngine.prototype.rebase = function(targetSource, currentLocation) {
|
||||||
pQueue = pQueue.concat(popped.get('parents'));
|
pQueue = pQueue.concat(popped.get('parents'));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.rebaseFinish(toRebaseRough, stopSet, targetSource, currentLocation);
|
return this.rebaseFinish(toRebaseRough, stopSet, targetSource, currentLocation, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.rebaseInteractive = function(targetSource, currentLocation) {
|
GitEngine.prototype.rebaseInteractive = function(targetSource, currentLocation) {
|
||||||
|
@ -24780,11 +24866,18 @@ GitEngine.prototype.filterRebaseCommits = function(toRebaseRough, stopSet) {
|
||||||
}, this);
|
}, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.rebaseFinish = function(toRebaseRough, stopSet, targetSource, currentLocation) {
|
GitEngine.prototype.rebaseFinish = function(
|
||||||
|
toRebaseRough,
|
||||||
|
stopSet,
|
||||||
|
targetSource,
|
||||||
|
currentLocation,
|
||||||
|
options
|
||||||
|
) {
|
||||||
|
options = options || {};
|
||||||
// now we have the all the commits between currentLocation and the set of target to rebase.
|
// now we have the all the commits between currentLocation and the set of target to rebase.
|
||||||
var destinationBranch = this.resolveID(targetSource);
|
var destinationBranch = this.resolveID(targetSource);
|
||||||
var deferred = Q.defer();
|
var deferred = options.deferred || Q.defer();
|
||||||
var chain = deferred.promise;
|
var chain = options.chain || deferred.promise;
|
||||||
|
|
||||||
var toRebase = this.filterRebaseCommits(toRebaseRough, stopSet);
|
var toRebase = this.filterRebaseCommits(toRebaseRough, stopSet);
|
||||||
if (!toRebase.length) {
|
if (!toRebase.length) {
|
||||||
|
@ -24833,7 +24926,10 @@ GitEngine.prototype.rebaseFinish = function(toRebaseRough, stopSet, targetSource
|
||||||
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
this.animationQueue.thenFinish(chain, deferred);
|
if (!options.dontResolvePromise) {
|
||||||
|
this.animationQueue.thenFinish(chain, deferred);
|
||||||
|
}
|
||||||
|
return chain;
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.mergeStarter = function() {
|
GitEngine.prototype.mergeStarter = function() {
|
||||||
|
|
1
build/bundle.min.4253d356.js
Normal file
1
build/bundle.min.4253d356.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
build/bundle.min.js
vendored
2
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.53c1d8c4.js"></script>
|
<script src="build/bundle.min.4253d356.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
|
||||||
|
|
|
@ -999,12 +999,50 @@ GitEngine.prototype.pull = function() {
|
||||||
});
|
});
|
||||||
// then either rebase or merge
|
// then either rebase or merge
|
||||||
if (this.commandOptions['--rebase']) {
|
if (this.commandOptions['--rebase']) {
|
||||||
this.rebase('o/master', 'master');
|
this.pullFinishWithRebase(pendingFetch, localBranch, remoteBranch);
|
||||||
} else {
|
} else {
|
||||||
this.pullFinishWithMerge(pendingFetch, localBranch, remoteBranch);
|
this.pullFinishWithMerge(pendingFetch, localBranch, remoteBranch);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GitEngine.prototype.pullFinishWithRebase = function(
|
||||||
|
pendingFetch,
|
||||||
|
localBranch,
|
||||||
|
remoteBranch
|
||||||
|
) {
|
||||||
|
var chain = pendingFetch.chain;
|
||||||
|
var deferred = pendingFetch.deferred;
|
||||||
|
|
||||||
|
// delay a bit after the intense refresh animation from
|
||||||
|
// fetch
|
||||||
|
chain = chain.then(function() {
|
||||||
|
return AnimationFactory.getDelayedPromise(300);
|
||||||
|
});
|
||||||
|
|
||||||
|
chain = chain.then(_.bind(function() {
|
||||||
|
// highlight last commit on o/master to color of
|
||||||
|
// local branch
|
||||||
|
return AnimationFactory.playHighlightPromiseAnimation(
|
||||||
|
this.getCommitFromRef(remoteBranch),
|
||||||
|
localBranch
|
||||||
|
);
|
||||||
|
}, this));
|
||||||
|
|
||||||
|
chain = chain.then(_.bind(function() {
|
||||||
|
pendingFetch.dontResolvePromise = true;
|
||||||
|
return this.rebase(remoteBranch, localBranch, pendingFetch);
|
||||||
|
}, this));
|
||||||
|
|
||||||
|
chain = chain.then(_.bind(function() {
|
||||||
|
// HAX
|
||||||
|
var localCommit = localBranch.get('target');
|
||||||
|
this.setTargetLocation(this.refs['o/master'], localCommit);
|
||||||
|
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
||||||
|
}, this));
|
||||||
|
|
||||||
|
this.animationQueue.thenFinish(chain, deferred);
|
||||||
|
};
|
||||||
|
|
||||||
GitEngine.prototype.pullFinishWithMerge = function(
|
GitEngine.prototype.pullFinishWithMerge = function(
|
||||||
pendingFetch,
|
pendingFetch,
|
||||||
localBranch,
|
localBranch,
|
||||||
|
@ -1484,7 +1522,7 @@ GitEngine.prototype.rebaseStarter = function() {
|
||||||
this.rebase(this.generalArgs[0], this.generalArgs[1]);
|
this.rebase(this.generalArgs[0], this.generalArgs[1]);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.rebase = function(targetSource, currentLocation) {
|
GitEngine.prototype.rebase = function(targetSource, currentLocation, options) {
|
||||||
// first some conditions
|
// first some conditions
|
||||||
if (this.isUpstreamOf(targetSource, currentLocation)) {
|
if (this.isUpstreamOf(targetSource, currentLocation)) {
|
||||||
this.command.setResult(intl.str('git-result-uptodate'));
|
this.command.setResult(intl.str('git-result-uptodate'));
|
||||||
|
@ -1535,7 +1573,7 @@ GitEngine.prototype.rebase = function(targetSource, currentLocation) {
|
||||||
pQueue = pQueue.concat(popped.get('parents'));
|
pQueue = pQueue.concat(popped.get('parents'));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.rebaseFinish(toRebaseRough, stopSet, targetSource, currentLocation);
|
return this.rebaseFinish(toRebaseRough, stopSet, targetSource, currentLocation, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.rebaseInteractive = function(targetSource, currentLocation) {
|
GitEngine.prototype.rebaseInteractive = function(targetSource, currentLocation) {
|
||||||
|
@ -1645,11 +1683,18 @@ GitEngine.prototype.filterRebaseCommits = function(toRebaseRough, stopSet) {
|
||||||
}, this);
|
}, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.rebaseFinish = function(toRebaseRough, stopSet, targetSource, currentLocation) {
|
GitEngine.prototype.rebaseFinish = function(
|
||||||
|
toRebaseRough,
|
||||||
|
stopSet,
|
||||||
|
targetSource,
|
||||||
|
currentLocation,
|
||||||
|
options
|
||||||
|
) {
|
||||||
|
options = options || {};
|
||||||
// now we have the all the commits between currentLocation and the set of target to rebase.
|
// now we have the all the commits between currentLocation and the set of target to rebase.
|
||||||
var destinationBranch = this.resolveID(targetSource);
|
var destinationBranch = this.resolveID(targetSource);
|
||||||
var deferred = Q.defer();
|
var deferred = options.deferred || Q.defer();
|
||||||
var chain = deferred.promise;
|
var chain = options.chain || deferred.promise;
|
||||||
|
|
||||||
var toRebase = this.filterRebaseCommits(toRebaseRough, stopSet);
|
var toRebase = this.filterRebaseCommits(toRebaseRough, stopSet);
|
||||||
if (!toRebase.length) {
|
if (!toRebase.length) {
|
||||||
|
@ -1698,7 +1743,10 @@ GitEngine.prototype.rebaseFinish = function(toRebaseRough, stopSet, targetSource
|
||||||
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
this.animationQueue.thenFinish(chain, deferred);
|
if (!options.dontResolvePromise) {
|
||||||
|
this.animationQueue.thenFinish(chain, deferred);
|
||||||
|
}
|
||||||
|
return chain;
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.mergeStarter = function() {
|
GitEngine.prototype.mergeStarter = function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue