quick implementation of git status

This commit is contained in:
Peter Cottle 2012-10-20 18:12:37 -07:00
parent b944a23790
commit 51a92227c3
4 changed files with 30 additions and 1 deletions

View file

@ -117,7 +117,8 @@ var Command = Backbone.Model.extend({
revert: /^revert($|\s)/,
log: /^log($|\s)/,
merge: /^merge($|\s)/,
show: /^show($|\s)/
show: /^show($|\s)/,
status: /^status($|\s)/
};
},
@ -246,6 +247,7 @@ OptionParser.prototype.getMasterOptionMap = function() {
'-am': false, // warning
'-m': false
},
status: {},
log: {},
add: {},
branch: {

View file

@ -299,6 +299,7 @@ var CommandLineHistoryView = Backbone.View.extend({
}
if (cD.clientHeight > t.clientHeight) {
$(t).css('overflow-y', 'scroll');
$(t).css('overflow-x', 'hidden');
$(t).addClass('scrolling');
t.scrollTop = t.scrollHeight;
}

View file

@ -1091,6 +1091,30 @@ GitEngine.prototype.show = function(ref) {
});
};
GitEngine.prototype.statusStarter = function() {
var lines = [];
if (this.getDetachedHead()) {
lines.push('Detached Head!');
} else {
var branchName = this.HEAD.get('target').get('id');
lines.push('On branch ' + branchName);
}
lines.push('Changes to be committed:');
lines.push('');
lines.push('    modified: cal/OskiCostume.stl');
lines.push('');
lines.push('Ready to commit! (as always in this demo)');
var msg = '';
_.each(lines, function(line) {
msg += '# ' + line + '\n';
});
throw new CommandResult({
msg: msg
});
};
GitEngine.prototype.logStarter = function() {
if (this.generalArgs.length > 1) {
throw new GitError({

View file

@ -5,10 +5,12 @@ Big things:
Big Graphic things:
~~~~~~~~~~~~~~~~~~~~~~~~~
- gitVisuals OVERHAUL. Will make the load / save tree easier
Medium things:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Rebuilding trees from a JSON snapshot / blob. this should be easy... i think. if we remove the need for parents
- gitEngine loads from tree immediately, not the weird thing we have now
Small things to implement:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~