mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 17:00:04 +02:00
NICE git log branch ^branchB
This commit is contained in:
parent
96b8356475
commit
60214f93b2
2 changed files with 21 additions and 6 deletions
23
src/git.js
23
src/git.js
|
@ -1359,11 +1359,30 @@ GitEngine.prototype.statusStarter = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.logStarter = function() {
|
GitEngine.prototype.logStarter = function() {
|
||||||
|
if (this.generalArgs.length == 2) {
|
||||||
|
// do fancy git log branchA ^branchB
|
||||||
|
if (this.generalArgs[1][0] == '^') {
|
||||||
|
this.logWithout(this.generalArgs[0], this.generalArgs[1]);
|
||||||
|
} else {
|
||||||
|
throw new GitError({
|
||||||
|
msg: 'I need a not branch (^branchName) when getting two arguments!'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.oneArgImpliedHead(this.generalArgs);
|
this.oneArgImpliedHead(this.generalArgs);
|
||||||
this.log(this.generalArgs[0]);
|
this.log(this.generalArgs[0]);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.log = function(ref) {
|
GitEngine.prototype.logWithout = function(ref, omitBranch) {
|
||||||
|
// slice off the ^branch
|
||||||
|
omitBranch = omitBranch.slice(1);
|
||||||
|
this.log(ref, this.getUpstreamSet(omitBranch));
|
||||||
|
};
|
||||||
|
|
||||||
|
GitEngine.prototype.log = function(ref, omitSet) {
|
||||||
|
// omit set is for doing stuff like git log branchA ^branchB
|
||||||
|
omitSet = omitSet || {};
|
||||||
// first get the commit we referenced
|
// first get the commit we referenced
|
||||||
var commit = this.getCommitFromRef(ref);
|
var commit = this.getCommitFromRef(ref);
|
||||||
|
|
||||||
|
@ -1375,7 +1394,7 @@ GitEngine.prototype.log = function(ref) {
|
||||||
|
|
||||||
while (pQueue.length) {
|
while (pQueue.length) {
|
||||||
var popped = pQueue.shift(0);
|
var popped = pQueue.shift(0);
|
||||||
if (seen[popped.get('id')]) {
|
if (seen[popped.get('id')] || omitSet[popped.get('id')]) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
seen[popped.get('id')] = true;
|
seen[popped.get('id')] = true;
|
||||||
|
|
4
todo.txt
4
todo.txt
|
@ -32,10 +32,6 @@ Pre-publish things:
|
||||||
- minify JS
|
- minify JS
|
||||||
- fix terminal input when extra long
|
- fix terminal input when extra long
|
||||||
|
|
||||||
extra command ideas:
|
|
||||||
|
|
||||||
git log branchA ^branchB
|
|
||||||
|
|
||||||
2013 Things
|
2013 Things
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
Tree layout with the layout engine provided in d3.js, that white-paper algorithm. Only tricky thing is that merge commits mess up the "tree" aspect and it doesn't directly support weighting, but I can probably throw that in.
|
Tree layout with the layout engine provided in d3.js, that white-paper algorithm. Only tricky thing is that merge commits mess up the "tree" aspect and it doesn't directly support weighting, but I can probably throw that in.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue