diff --git a/src/git.js b/src/git.js index 4a339f2c..79f39f23 100644 --- a/src/git.js +++ b/src/git.js @@ -1359,11 +1359,30 @@ GitEngine.prototype.statusStarter = 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.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 var commit = this.getCommitFromRef(ref); @@ -1375,7 +1394,7 @@ GitEngine.prototype.log = function(ref) { while (pQueue.length) { var popped = pQueue.shift(0); - if (seen[popped.get('id')]) { + if (seen[popped.get('id')] || omitSet[popped.get('id')]) { continue; } seen[popped.get('id')] = true; diff --git a/todo.txt b/todo.txt index 96a1dec7..78fea883 100644 --- a/todo.txt +++ b/todo.txt @@ -32,10 +32,6 @@ Pre-publish things: - minify JS - fix terminal input when extra long -extra command ideas: - -git log branchA ^branchB - 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.