You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/04/23 17:04:30 UTC
git commit: Add git status output to repo-status. Make command less
verbose
Repository: cordova-coho
Updated Branches:
refs/heads/master df510501b -> f1a1a0f8c
Add git status output to repo-status. Make command less verbose
Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/f1a1a0f8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/f1a1a0f8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/f1a1a0f8
Branch: refs/heads/master
Commit: f1a1a0f8c646334611325ac967db36df6d923d53
Parents: df51050
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Apr 23 10:42:37 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Apr 23 11:02:41 2014 -0400
----------------------------------------------------------------------
coho | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/f1a1a0f8/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index b765514..0facc81 100755
--- a/coho
+++ b/coho
@@ -490,6 +490,7 @@ function execHelper(cmd, silent, allowError) {
if (/^git commit/.exec(cmd)) {
gitCommitCount++;
}
+ cmd = cmd.replace(/^git /, 'git -c color.ui=always ');
if (!silent) {
print('Executing:', cmd);
}
@@ -1021,15 +1022,15 @@ function repoStatusCommand(argv) {
desc: 'The name of the branch to diff against. This is origin/$branch by default.'
})
.options('diff', {
- desc: 'Show a diff of the changes (use --no-diff to disable)',
- default: true
+ desc: 'Show a diff of the changes.',
+ default: false
})
opt = registerHelpFlag(opt);
var argv = opt
.usage('Reports what changes exist locally that are not yet pushed.\n' +
'\n' +
'Example usage: $0 repo-status -r auto -b master -b 2.9.x\n' +
- 'Example usage: $0 repo-status -r plugins -b dev --branch2 master --no-diff')
+ 'Example usage: $0 repo-status -r plugins -b dev --branch2 master --diff')
.argv;
if (argv.h) {
@@ -1059,12 +1060,15 @@ function repoStatusCommand(argv) {
var targetBranch = branches2 ? branches2[i] : (remoteBranchExists(repo, branchName) ? repo.remoteName + '/' + branchName : 'master');
var changes = execHelper('git log --no-merges --oneline ' + targetBranch + '..' + branchName, true);
if (changes) {
- print(repo.repoName + ' on branch ' + branchName + ' (vs ' + targetBranch + '): Commits exist.');
+ print('Local commits exist on ' + branchName + ':');
console.log(changes);
- } else {
- print(repo.repoName + ' on branch ' + branchName + ' (vs ' + targetBranch + '): No changes');
}
});
+ var gitStatus = execHelper('git status --short', true);
+ if (gitStatus) {
+ print('Uncommitted changes:');
+ console.log(gitStatus);
+ }
});
if (argv.diff) {
forEachRepo(repos, function(repo) {