diff options
| author | Chris Ball <chris@printf.net> | 2015-06-03 16:28:26 -0400 |
|---|---|---|
| committer | Chris Ball <chris@printf.net> | 2015-06-03 16:28:30 -0400 |
| commit | 60877cc734120057a069ca5ba220ddf694774977 (patch) | |
| tree | 2c1625e380d552366cf824381ea3a9b27e655dbf | |
| parent | 0af44fb305e1bc6af86e231959442edf14ad4649 (diff) | |
git-remote-gittorrent: Trivial output cleanups
| -rwxr-xr-x | git-remote-gittorrent | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/git-remote-gittorrent b/git-remote-gittorrent index 5c9f038..c567588 100755 --- a/git-remote-gittorrent +++ b/git-remote-gittorrent @@ -93,7 +93,7 @@ if (matches) { var json = res.v.toString() var repos = JSON.parse(json) console.warn('\nMutable key ' + chalk.green(key) + ' returned:\n' + - prettyjson.render(repos, {keysColor: 'yellow', valuesColor: 'green'})) + prettyjson.render(repos, {keysColor: 'yellow', valuesColor: 'green'}) + '\n') talk_to_git(repos.repositories[reponame]) }) }) @@ -126,7 +126,6 @@ if (matches) { refs[branch] = sha }) }) - } var fetching = {} // Maps shas -> {got: <bool>, swarm, branches: [...]} @@ -145,8 +144,6 @@ function update_ref (sha) { fetching[sha].branches.forEach(function (branch) { branch = remotename + '/' + branch spawn('git', ['update-ref', branch, sha]) - console.warn('git update-ref ' + chalk.yellow(branch) + ' ' + - chalk.green(sha)) }) } @@ -155,12 +152,13 @@ function get_infohash (sha, branch) { branch = branch.replace(/\/head$/, '') // We use console.warn (stderr) because git ignores our writes to stdout. - console.warn('\nOkay, we want to get ' + chalk.yellow(branch) + ': ' + - chalk.green(sha) + '\n') + console.warn('Okay, we want to get ' + chalk.yellow(branch) + ': ' + + chalk.green(sha)) if (sha in fetching) { fetching[sha].branches.push(branch) - return // Prevent starting a redundant lookups + // Prevent starting a redundant lookup + return } var info = {got: false, peer: false, swarm: null, branches: [branch]} @@ -173,8 +171,8 @@ function get_infohash (sha, branch) { var peerId = new Buffer('-WW' + VERSION + '-' + hat(48), 'utf8') info.swarm = new Swarm(parsed.infoHash, peerId) info.swarm.on('wire', function (wire, addr) { - console.warn('Adding swarm peer: ' + chalk.green(addr) + ' for ' + - chalk.red(parsed.infoHash) + '\n') + console.warn('\nAdding swarm peer: ' + chalk.green(addr) + ' for ' + + chalk.green(parsed.infoHash)) wire.use(ut_gittorrent()) wire.ut_gittorrent.on('handshake', function () { wire.ut_gittorrent.ask(parsed.infoHash) |
