Commit 166b334638de380d7122a769ba94815c338236af
Add verbose output under env var
Charles Lehner committed on 7/30/2016, 9:49:24 PMParent: 8abcce7cf104e77dbb7a4c2f6175031ea9dbab55
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -452,9 +452,9 @@ | ||
452 | 452 | |
453 | 453 | module.exports = function (repo) { |
454 | 454 | var ended |
455 | 455 | var options = { |
456 | - verbosity: 1, | |
456 | + verbosity: +process.env.GIT_VERBOSITY || 1, | |
457 | 457 | progress: false |
458 | 458 | } |
459 | 459 | |
460 | 460 | repo = Repo(repo) |
@@ -488,9 +488,15 @@ | ||
488 | 488 | } |
489 | 489 | |
490 | 490 | return function (read) { |
491 | 491 | var b = buffered() |
492 | + if (options.verbosity >= 3) { | |
493 | + read = pull.through(function (data) { | |
494 | + console.error('>', JSON.stringify(data.toString('ascii'))) | |
495 | + })(read) | |
496 | + } | |
492 | 497 | b(read) |
498 | + | |
493 | 499 | var command |
494 | 500 | |
495 | 501 | function getCommand(cb) { |
496 | 502 | b.lines(null, function next(end, line) { |
@@ -527,8 +533,11 @@ | ||
527 | 533 | cb(err, data) |
528 | 534 | else |
529 | 535 | next(abort, cb) |
530 | 536 | } else { |
537 | + if (options.verbosity >= 3) { | |
538 | + console.error('<', JSON.stringify(data)) | |
539 | + } | |
531 | 540 | cb(null, data) |
532 | 541 | } |
533 | 542 | }) |
534 | 543 | } |
Built with git-ssb-web