git ssb

0+

cel / pull-git-remote-helper



Commit 166b334638de380d7122a769ba94815c338236af

Add verbose output under env var

Charles Lehner committed on 7/30/2016, 9:49:24 PM
Parent: 8abcce7cf104e77dbb7a4c2f6175031ea9dbab55

Files changed

index.jschanged
index.jsView
@@ -452,9 +452,9 @@
452452
453453 module.exports = function (repo) {
454454 var ended
455455 var options = {
456- verbosity: 1,
456+ verbosity: +process.env.GIT_VERBOSITY || 1,
457457 progress: false
458458 }
459459
460460 repo = Repo(repo)
@@ -488,9 +488,15 @@
488488 }
489489
490490 return function (read) {
491491 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+ }
492497 b(read)
498+
493499 var command
494500
495501 function getCommand(cb) {
496502 b.lines(null, function next(end, line) {
@@ -527,8 +533,11 @@
527533 cb(err, data)
528534 else
529535 next(abort, cb)
530536 } else {
537+ if (options.verbosity >= 3) {
538+ console.error('<', JSON.stringify(data))
539+ }
531540 cb(null, data)
532541 }
533542 })
534543 }

Built with git-ssb-web