From bcb25299e3ad4af71de348fa62dc6027b80cdc12 Mon Sep 17 00:00:00 2001 From: cel Date: Sat, 30 Dec 2017 13:38:57 -1000 Subject: Serve files in zip blobs --- package-lock.json | 184 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 168 insertions(+), 16 deletions(-) (limited to 'package-lock.json') diff --git a/package-lock.json b/package-lock.json index ae79d80..0f5d62f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,15 @@ "resolved": "http://localhost:8989/blobs/get/&tix85Coqflfg1RbOQ/x6cq0E1Rry5rDhGiIHyRdM+8s=.sha256", "integrity": "sha256-tix85Coqflfg1RbOQ/x6cq0E1Rry5rDhGiIHyRdM+8s=" }, + "binary": { + "version": "0.3.0", + "resolved": "http://localhost:8989/blobs/get/&lAvJtA+yqHWHbjyhvj0Fp6QZiB5CAcdsg/+7BVaLaQk=.sha256", + "integrity": "sha256-lAvJtA+yqHWHbjyhvj0Fp6QZiB5CAcdsg/+7BVaLaQk=", + "requires": { + "buffers": "0.1.1", + "chainsaw": "0.1.0" + } + }, "brace-expansion": { "version": "http://localhost:8989/blobs/get/&fdjQQT88BvLg9ynhFsffO5ZCC04SoSTrnmmGGWWxcPo=.sha256", "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", @@ -42,6 +51,11 @@ "version": "http://localhost:8989/blobs/get/&u3cvbnn1mLUZCBFO3qRNABW3op1sgtwIK2UCQ/RIYGY=.sha256", "integrity": "sha1-QUGcrvdpdVkp3VGJZ9PuwKYmJ3E=" }, + "buffers": { + "version": "0.1.1", + "resolved": "http://localhost:8989/blobs/get/&+N5Jxg5GcAUYLZaHtdh3dbvOxjhaxjIgt3QTJ0Qd620=.sha256", + "integrity": "sha256-+N5Jxg5GcAUYLZaHtdh3dbvOxjhaxjIgt3QTJ0Qd620=" + }, "builtin-modules": { "version": "http://localhost:8989/blobs/get/&54lxeCToaIJpwkHCA9n2Fc8VKG1iF9dN78fzlbDaXxE=.sha256", "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" @@ -60,6 +74,14 @@ "resolved": "http://localhost:8989/blobs/get/&mjv2gAClOLf1jZaoHspyZ5ZbBYFn6imQeCwXDtp1kvU=.sha256", "integrity": "sha256-mjv2gAClOLf1jZaoHspyZ5ZbBYFn6imQeCwXDtp1kvU=" }, + "chainsaw": { + "version": "0.1.0", + "resolved": "http://localhost:8989/blobs/get/&AVhqaqHRF0rgev9pgi0B4HBP4w8jrCIiHJuAS6uXbPs=.sha256", + "integrity": "sha256-AVhqaqHRF0rgev9pgi0B4HBP4w8jrCIiHJuAS6uXbPs=", + "requires": { + "traverse": "0.3.9" + } + }, "chloride": { "version": "2.2.7", "resolved": "http://localhost:8989/blobs/get/&/ahFOC6wlOMnO1HdAIAcuY6NQ9AkKjmR1Os/xnts6N8=.sha256", @@ -216,6 +238,27 @@ "version": "http://localhost:8989/blobs/get/&noDLhxMSWqU9+BopYm97gfJqm+HNQYQLPM3K5NUuj5w=.sha256", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "fstream": { + "version": "0.1.31", + "resolved": "http://localhost:8989/blobs/get/&MgatCTGF+duNaFmT4+Nyh0UEi9rjNltsqSTLdeLCKwE=.sha256", + "integrity": "sha256-MgatCTGF+duNaFmT4+Nyh0UEi9rjNltsqSTLdeLCKwE=", + "requires": { + "graceful-fs": "3.0.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.2" + }, + "dependencies": { + "graceful-fs": { + "version": "3.0.11", + "resolved": "http://localhost:8989/blobs/get/&WtP5g2DDTtr9aihenL4LdIICzr9RtKdKV9qRCFH1JQM=.sha256", + "integrity": "sha256-WtP5g2DDTtr9aihenL4LdIICzr9RtKdKV9qRCFH1JQM=", + "requires": { + "natives": "1.1.0" + } + } + } + }, "get-caller-file": { "version": "1.0.2", "resolved": "http://localhost:8989/blobs/get/&FMgvATYUUtPunnh52Q5mgZVX2OhKaewPbHxlxlYwSac=.sha256", @@ -437,6 +480,27 @@ "yallist": "http://localhost:8989/blobs/get/&x7MQhNNSXhcxS0bCjljOts2PEKn/km2vSDA5dvissLI=.sha256" } }, + "match-stream": { + "version": "0.0.2", + "resolved": "http://localhost:8989/blobs/get/&8ifmMRW33QbZzSrMY/n26MvE9tZtdgdmHG2P8iAx9/w=.sha256", + "integrity": "sha256-8ifmMRW33QbZzSrMY/n26MvE9tZtdgdmHG2P8iAx9/w=", + "requires": { + "buffers": "0.1.1", + "readable-stream": "1.0.34" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "http://localhost:8989/blobs/get/&0QEMlyAUePLZCW/tXOEhdYfVI4R19FBv4JyHzdW8VqY=.sha256", + "requires": { + "core-util-is": "http://localhost:8989/blobs/get/&pKRNq2V57ePgat5Y0m+P1kLq4JFT/VnGCPy3lRpJk5g=.sha256", + "inherits": "2.0.3", + "isarray": "http://localhost:8989/blobs/get/&PoREAgaWgArtkqCdTFJgKtx2FAo5tsjpT+fInPcKnwo=.sha256", + "string_decoder": "http://localhost:8989/blobs/get/&Pm5v/q/mFX6yJ4qQmvwLhFI0sTRG3KipUYwrebnCIIY=.sha256" + } + } + } + }, "mem": { "version": "1.1.0", "resolved": "http://localhost:8989/blobs/get/&JPEeBd7nMfhv4111AT1r8bKQHDHp5jbjOlgYO63qN5I=.sha256", @@ -527,6 +591,11 @@ "integrity": "sha256-dF6wPKUaGRuuJwIvKGrSOSZpzkskLzu2eXPH9iZqSKs=", "optional": true }, + "natives": { + "version": "1.1.0", + "resolved": "http://localhost:8989/blobs/get/&Xc7wzjsjGc4j8E08ehRgLsKR8ETg+IRu5fMxRHJryZA=.sha256", + "integrity": "sha256-Xc7wzjsjGc4j8E08ehRgLsKR8ETg+IRu5fMxRHJryZA=" + }, "node-gyp-build": { "version": "3.2.2", "resolved": "http://localhost:8989/blobs/get/&4FlrrtCACsITHl9W+Fo8zZxpVDu6KPKVlqzJERNerJo=.sha256", @@ -597,6 +666,11 @@ "mem": "1.1.0" } }, + "over": { + "version": "0.0.5", + "resolved": "http://localhost:8989/blobs/get/&2SFVsXLBCq9u2cfVbIv27fccQ+MOAk5V8HAOWGbFwK4=.sha256", + "integrity": "sha256-2SFVsXLBCq9u2cfVbIv27fccQ+MOAk5V8HAOWGbFwK4=" + }, "p-finally": { "version": "1.0.0", "resolved": "http://localhost:8989/blobs/get/&7/2E4J4TMFQqhKJD8fTaIacA1Fm4N2HqyhYHDrH7iEE=.sha256", @@ -699,8 +773,8 @@ "integrity": "sha256-+uVE8RHNwJIJa68sQGICGbxnCTCOdLLhSt/Pb4NmgL0=" }, "pull-defer": { - "version": "0.2.2", - "resolved": "http://localhost:8989/blobs/get/&mDI2o/JC9yvFOVbeAhDN+hwTm7cK+dBwISYO49EMY24=.sha256" + "version": "http://localhost:8989/blobs/get/&mDI2o/JC9yvFOVbeAhDN+hwTm7cK+dBwISYO49EMY24=.sha256", + "integrity": "sha1-CIew/7MK8ypW2+z6csFnInHwexM=" }, "pull-git-packidx-parser": { "version": "http://localhost:8989/blobs/get/&ou0MPQZabBgzrHDu54jzLU3Sc6Rf5a/lost0whPQUJ0=.sha256", @@ -777,8 +851,8 @@ } }, "pull-many": { - "version": "1.0.8", - "resolved": "http://localhost:8989/blobs/get/&wBHfPheBEjwjjkNoeM5mWtU/tYDs8+xnt5w6C1+EK3g=.sha256", + "version": "http://localhost:8989/blobs/get/&wBHfPheBEjwjjkNoeM5mWtU/tYDs8+xnt5w6C1+EK3g=.sha256", + "integrity": "sha1-Pa3ZttFWxUVyG9qNAAPdjqoGKT4=", "requires": { "pull-stream": "3.6.1" } @@ -840,6 +914,29 @@ "ws": "1.1.4" } }, + "pullstream": { + "version": "0.4.1", + "resolved": "http://localhost:8989/blobs/get/&dU4CcxT0bjZmQhlL7P9dpSxkrrm+K5JOy8/1SDVpwSs=.sha256", + "integrity": "sha256-dU4CcxT0bjZmQhlL7P9dpSxkrrm+K5JOy8/1SDVpwSs=", + "requires": { + "over": "0.0.5", + "readable-stream": "1.0.34", + "setimmediate": "1.0.5", + "slice-stream": "1.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "http://localhost:8989/blobs/get/&0QEMlyAUePLZCW/tXOEhdYfVI4R19FBv4JyHzdW8VqY=.sha256", + "requires": { + "core-util-is": "http://localhost:8989/blobs/get/&pKRNq2V57ePgat5Y0m+P1kLq4JFT/VnGCPy3lRpJk5g=.sha256", + "inherits": "2.0.3", + "isarray": "http://localhost:8989/blobs/get/&PoREAgaWgArtkqCdTFJgKtx2FAo5tsjpT+fInPcKnwo=.sha256", + "string_decoder": "http://localhost:8989/blobs/get/&Pm5v/q/mFX6yJ4qQmvwLhFI0sTRG3KipUYwrebnCIIY=.sha256" + } + } + } + }, "rc": { "version": "1.2.1", "resolved": "http://localhost:8989/blobs/get/&XPry2asXmpIfJLFtlg5hZmO2uM0QlZd5nCr/AJBOLek=.sha256", @@ -895,6 +992,14 @@ "resolved": "http://localhost:8989/blobs/get/&Y6ct0k73eVjQG88nl6Ll/lfhxdEVefvRvci3hMiZmcM=.sha256", "integrity": "sha256-Y6ct0k73eVjQG88nl6Ll/lfhxdEVefvRvci3hMiZmcM=" }, + "rimraf": { + "version": "2.6.2", + "resolved": "http://localhost:8989/blobs/get/&5u4iUQN5Nebmc0+RrO4XpcxAXxAREHuP7ND3+WhZKd4=.sha256", + "integrity": "sha256-5u4iUQN5Nebmc0+RrO4XpcxAXxAREHuP7ND3+WhZKd4=", + "requires": { + "glob": "http://localhost:8989/blobs/get/&zz0+R6Ewi1Ev1wfx31k3N8tWkHnQS/l14fxI3mpintE=.sha256" + } + }, "safe-buffer": { "version": "5.1.1", "resolved": "http://localhost:8989/blobs/get/&DBRHICIwyQWmEc+9TG2DT/zR9Zja3LyNW+dIJuXjsXE=.sha256", @@ -925,6 +1030,11 @@ "version": "http://localhost:8989/blobs/get/&2TSu59ueCdoJ6HckdDMV/+iIEwqm4E+73srJhfauaT0=.sha256", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, + "setimmediate": { + "version": "1.0.5", + "resolved": "http://localhost:8989/blobs/get/&XLn8ImmDZO1CwC1qo9xQ/+r6aEUq6EaZZy49/XSSLJ4=.sha256", + "integrity": "sha256-XLn8ImmDZO1CwC1qo9xQ/+r6aEUq6EaZZy49/XSSLJ4=" + }, "sha.js": { "version": "2.4.5", "resolved": "http://localhost:8989/blobs/get/&JxjiN22oEOlVmJQn3aII8ykRlfimM2Ph+URrf/2KZhs=.sha256", @@ -948,6 +1058,26 @@ "version": "http://localhost:8989/blobs/get/&2JAO0FDbn45cJ1KdQ8Al0Lu7FnN8oZnYa9UP3Ixb0tg=.sha256", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, + "slice-stream": { + "version": "1.0.0", + "resolved": "http://localhost:8989/blobs/get/&vZJmJejF0Cfij1r3a/BjIvBStHkzidwIh8n5j5k63Us=.sha256", + "integrity": "sha256-vZJmJejF0Cfij1r3a/BjIvBStHkzidwIh8n5j5k63Us=", + "requires": { + "readable-stream": "1.0.34" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "http://localhost:8989/blobs/get/&0QEMlyAUePLZCW/tXOEhdYfVI4R19FBv4JyHzdW8VqY=.sha256", + "requires": { + "core-util-is": "http://localhost:8989/blobs/get/&pKRNq2V57ePgat5Y0m+P1kLq4JFT/VnGCPy3lRpJk5g=.sha256", + "inherits": "2.0.3", + "isarray": "http://localhost:8989/blobs/get/&PoREAgaWgArtkqCdTFJgKtx2FAo5tsjpT+fInPcKnwo=.sha256", + "string_decoder": "http://localhost:8989/blobs/get/&Pm5v/q/mFX6yJ4qQmvwLhFI0sTRG3KipUYwrebnCIIY=.sha256" + } + } + } + }, "smart-buffer": { "version": "1.1.15", "resolved": "http://localhost:8989/blobs/get/&WkLju39M7S7Fo0ag0wBPhdAHagB2f32gvxvGhsfZgfc=.sha256", @@ -1054,11 +1184,11 @@ } }, "ssb-contact": { - "version": "1.2.0", - "resolved": "http://localhost:8989/blobs/get/&V4bNrv533a7pKfPxw7Ok92hNWBN+eCbyybmi8cGMzrM=.sha256", + "version": "http://localhost:8989/blobs/get/&V4bNrv533a7pKfPxw7Ok92hNWBN+eCbyybmi8cGMzrM=.sha256", + "integrity": "sha1-lGp4PIQOWRbVEsRTiJYQlwWQzWw=", "requires": { - "pull-defer": "0.2.2", - "pull-many": "1.0.8", + "pull-defer": "http://localhost:8989/blobs/get/&mDI2o/JC9yvFOVbeAhDN+hwTm7cK+dBwISYO49EMY24=.sha256", + "pull-many": "http://localhost:8989/blobs/get/&wBHfPheBEjwjjkNoeM5mWtU/tYDs8+xnt5w6C1+EK3g=.sha256", "pull-stream": "3.6.1" } }, @@ -1076,14 +1206,6 @@ "version": "http://localhost:8989/blobs/get/&5yyYBZpB4w+X6kW42KMh43Xz9KP3XW79mYOj40/CHA4=.sha256", "integrity": "sha1-Fg4kETeCqcpegGByqnpl58hl2/I=" }, - "ssb-mentions": { - "version": "http://localhost:8989/blobs/get/&GKwsJ3ykvOXc24wyNuWBdmnCFpQ+Ltd9ggjoOuOF/Pg=.sha256", - "integrity": "sha1-en5LsSk2uHwNcjeC+b1ZMfuFef4=", - "requires": { - "ssb-marked": "http://localhost:8989/blobs/get/&5yyYBZpB4w+X6kW42KMh43Xz9KP3XW79mYOj40/CHA4=.sha256", - "ssb-ref": "http://localhost:8989/blobs/get/&wLimOD3785KVj7kBIAbjN6GH8EMhKRkcZSPrEMhdhks=.sha256" - } - }, "ssb-ref": { "version": "http://localhost:8989/blobs/get/&wLimOD3785KVj7kBIAbjN6GH8EMhKRkcZSPrEMhdhks=.sha256", "integrity": "sha1-XU7/xUXsD/1/wVuieCmmQLiir7o=", @@ -1176,6 +1298,11 @@ "resolved": "http://localhost:8989/blobs/get/&2+Rf668b9yZcJXMyQrwOesOLYy22qOGfA0GvR3BCWJk=.sha256", "integrity": "sha256-2+Rf668b9yZcJXMyQrwOesOLYy22qOGfA0GvR3BCWJk=" }, + "traverse": { + "version": "0.3.9", + "resolved": "http://localhost:8989/blobs/get/&eBP2sa38eIi/Jilni5wRnDaHQPA0jLlcxH4Fex4WCUI=.sha256", + "integrity": "sha256-eBP2sa38eIi/Jilni5wRnDaHQPA0jLlcxH4Fex4WCUI=" + }, "tweetnacl": { "version": "0.14.5", "resolved": "http://localhost:8989/blobs/get/&bOoz1nqb2D+L0lBlXHiiyJ6pErzGvpHI5lgHzmnP39Y=.sha256", @@ -1194,6 +1321,31 @@ "resolved": "http://localhost:8989/blobs/get/&x9CnHOGgcWXdpCT6uvXvsVHIbcTZ12GYkjEOgXE31BQ=.sha256", "integrity": "sha256-x9CnHOGgcWXdpCT6uvXvsVHIbcTZ12GYkjEOgXE31BQ=" }, + "unzip": { + "version": "0.1.11", + "resolved": "http://localhost:8989/blobs/get/&lUPDF4rcMYrDcMNc3I0oVd9vWMwOqoEHf7ycdfWAjOo=.sha256", + "integrity": "sha256-lUPDF4rcMYrDcMNc3I0oVd9vWMwOqoEHf7ycdfWAjOo=", + "requires": { + "binary": "0.3.0", + "fstream": "0.1.31", + "match-stream": "0.0.2", + "pullstream": "0.4.1", + "readable-stream": "1.0.34", + "setimmediate": "1.0.5" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "http://localhost:8989/blobs/get/&0QEMlyAUePLZCW/tXOEhdYfVI4R19FBv4JyHzdW8VqY=.sha256", + "requires": { + "core-util-is": "http://localhost:8989/blobs/get/&pKRNq2V57ePgat5Y0m+P1kLq4JFT/VnGCPy3lRpJk5g=.sha256", + "inherits": "2.0.3", + "isarray": "http://localhost:8989/blobs/get/&PoREAgaWgArtkqCdTFJgKtx2FAo5tsjpT+fInPcKnwo=.sha256", + "string_decoder": "http://localhost:8989/blobs/get/&Pm5v/q/mFX6yJ4qQmvwLhFI0sTRG3KipUYwrebnCIIY=.sha256" + } + } + } + }, "validate-npm-package-license": { "version": "http://localhost:8989/blobs/get/&FZFTRu/blzraNxOJt63Ut68JKa3cpNPwb1RBvaWZBW4=.sha256", "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", -- cgit v1.2.3 From bc7454fa1db558e89c8e8069d527c7b74a4ce60a Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 8 Jan 2018 15:48:04 -1000 Subject: Use readTreeFull and pull-catch --- lib/serve.js | 32 ++++++++++++++------------------ package-lock.json | 46 +++++++++++++++++++++++++++++++--------------- package.json | 1 + 3 files changed, 46 insertions(+), 33 deletions(-) (limited to 'package-lock.json') diff --git a/lib/serve.js b/lib/serve.js index 7c42d0c..eb8610c 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -22,6 +22,7 @@ var ph = require('pull-hyperscript') var emojis = require('emoji-named-characters') var jpeg = require('jpeg-autorotate') var unzip = require('unzip') +var Catch = require('pull-catch') module.exports = Serve @@ -1788,7 +1789,12 @@ Serve.prototype.gitCommit = function (rev) { : file.mode ? 'mode changed' : JSON.stringify(file)) ]) - }) + }), + Catch(function (err) { + if (err && err.name === 'ObjectNotFoundError') return + if (err && err.name === 'BlobNotFoundError') return self.askWantBlobsForm(err.links) + return false + }) )) ] ]), @@ -1909,23 +1915,8 @@ Serve.prototype.gitTree = function (rev) { ]), missingBlobs ? self.askWantBlobsForm(missingBlobs) : ph('table', [ pull( - self.app.git.readTree(obj), - paramap(function (file, cb) { - self.app.git.getObjectMsg({ - obj: file.hash, - headMsgId: obj.msg.key, - }, function (err, msg) { - if (err && err.name === 'ObjectNotFoundError') return cb(null, file) - if (err && err.name === 'BlobNotFoundError') return cb(null, {missingBlobs: err.links}) - if (err) return cb(err) - file.msg = msg - cb(null, file) - }) - }, 8), + self.app.git.readTreeFull(obj), pull.map(function (item) { - if (item.missingBlobs) { - return self.askWantBlobsForm(item.missingBlobs) - } if (!item.msg) return ph('tr', [ ph('td', u.escapeHTML(item.name) + (item.type === 'tree' ? '/' : '')), @@ -1950,7 +1941,12 @@ Serve.prototype.gitTree = function (rev) { }, htime(fileDate)) ), ]) - }) + }), + Catch(function (err) { + if (err && err.name === 'ObjectNotFoundError') return + if (err && err.name === 'BlobNotFoundError') return self.askWantBlobsForm(err.links) + return false + }) ) ]), ]), diff --git a/package-lock.json b/package-lock.json index 0f5d62f..8d381d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -492,6 +492,7 @@ "readable-stream": { "version": "1.0.34", "resolved": "http://localhost:8989/blobs/get/&0QEMlyAUePLZCW/tXOEhdYfVI4R19FBv4JyHzdW8VqY=.sha256", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { "core-util-is": "http://localhost:8989/blobs/get/&pKRNq2V57ePgat5Y0m+P1kLq4JFT/VnGCPy3lRpJk5g=.sha256", "inherits": "2.0.3", @@ -772,17 +773,15 @@ "resolved": "http://localhost:8989/blobs/get/&+uVE8RHNwJIJa68sQGICGbxnCTCOdLLhSt/Pb4NmgL0=.sha256", "integrity": "sha256-+uVE8RHNwJIJa68sQGICGbxnCTCOdLLhSt/Pb4NmgL0=" }, + "pull-catch": { + "version": "1.0.0", + "resolved": "http://localhost:8989/blobs/get/&K8t9klRhYJkdveaxSpBMFwzMtmNyLwNRTQUeCVnUvYU=.sha256", + "integrity": "sha256-K8t9klRhYJkdveaxSpBMFwzMtmNyLwNRTQUeCVnUvYU=" + }, "pull-defer": { "version": "http://localhost:8989/blobs/get/&mDI2o/JC9yvFOVbeAhDN+hwTm7cK+dBwISYO49EMY24=.sha256", "integrity": "sha1-CIew/7MK8ypW2+z6csFnInHwexM=" }, - "pull-git-packidx-parser": { - "version": "http://localhost:8989/blobs/get/&ou0MPQZabBgzrHDu54jzLU3Sc6Rf5a/lost0whPQUJ0=.sha256", - "integrity": "sha1-LYvwr+SCSJfuA4QL/k9ahq/syiE=", - "requires": { - "pull-stream": "3.6.1" - } - }, "pull-goodbye": { "version": "0.0.2", "resolved": "http://localhost:8989/blobs/get/&MQhN9Pp3BYaj0TzxK39JfAK7CjVceg1EPfNhhFnZ9sU=.sha256", @@ -842,14 +841,6 @@ } } }, - "pull-kvdiff": { - "version": "0.0.1", - "resolved": "http://localhost:8989/blobs/get/&xxfT88LrbK4FSIhpaNmIAt4jzsaBgVugeaDPVwC1gCU=.sha256", - "integrity": "sha256-xxfT88LrbK4FSIhpaNmIAt4jzsaBgVugeaDPVwC1gCU=", - "requires": { - "multicb": "1.2.2" - } - }, "pull-many": { "version": "http://localhost:8989/blobs/get/&wBHfPheBEjwjjkNoeM5mWtU/tYDs8+xnt5w6C1+EK3g=.sha256", "integrity": "sha1-Pa3ZttFWxUVyG9qNAAPdjqoGKT4=", @@ -928,6 +919,7 @@ "readable-stream": { "version": "1.0.34", "resolved": "http://localhost:8989/blobs/get/&0QEMlyAUePLZCW/tXOEhdYfVI4R19FBv4JyHzdW8VqY=.sha256", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { "core-util-is": "http://localhost:8989/blobs/get/&pKRNq2V57ePgat5Y0m+P1kLq4JFT/VnGCPy3lRpJk5g=.sha256", "inherits": "2.0.3", @@ -1069,6 +1061,7 @@ "readable-stream": { "version": "1.0.34", "resolved": "http://localhost:8989/blobs/get/&0QEMlyAUePLZCW/tXOEhdYfVI4R19FBv4JyHzdW8VqY=.sha256", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { "core-util-is": "http://localhost:8989/blobs/get/&pKRNq2V57ePgat5Y0m+P1kLq4JFT/VnGCPy3lRpJk5g=.sha256", "inherits": "2.0.3", @@ -1206,6 +1199,28 @@ "version": "http://localhost:8989/blobs/get/&5yyYBZpB4w+X6kW42KMh43Xz9KP3XW79mYOj40/CHA4=.sha256", "integrity": "sha1-Fg4kETeCqcpegGByqnpl58hl2/I=" }, + "ssb-mentions": { + "version": "http://localhost:8989/blobs/get/&GjuxknqKwJqHznKueFNCyIh52v1woz5PB41vqmoHfyM=.sha256", + "integrity": "sha1-AMd4SslTCsJi2h5902MlCCA1UEY=", + "requires": { + "ssb-marked": "http://localhost:8989/blobs/get/&5yyYBZpB4w+X6kW42KMh43Xz9KP3XW79mYOj40/CHA4=.sha256", + "ssb-ref": "2.7.1" + }, + "dependencies": { + "is-valid-domain": { + "version": "0.0.2", + "resolved": "http://localhost:8989/blobs/get/&phjiap+k1lGC5LPVba/w4Caomw5o0NQp2Hol+u/YAzE=.sha256" + }, + "ssb-ref": { + "version": "2.7.1", + "resolved": "http://localhost:8989/blobs/get/&wLimOD3785KVj7kBIAbjN6GH8EMhKRkcZSPrEMhdhks=.sha256", + "requires": { + "ip": "1.1.5", + "is-valid-domain": "0.0.2" + } + } + } + }, "ssb-ref": { "version": "http://localhost:8989/blobs/get/&wLimOD3785KVj7kBIAbjN6GH8EMhKRkcZSPrEMhdhks=.sha256", "integrity": "sha1-XU7/xUXsD/1/wVuieCmmQLiir7o=", @@ -1337,6 +1352,7 @@ "readable-stream": { "version": "1.0.34", "resolved": "http://localhost:8989/blobs/get/&0QEMlyAUePLZCW/tXOEhdYfVI4R19FBv4JyHzdW8VqY=.sha256", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { "core-util-is": "http://localhost:8989/blobs/get/&pKRNq2V57ePgat5Y0m+P1kLq4JFT/VnGCPy3lRpJk5g=.sha256", "inherits": "2.0.3", diff --git a/package.json b/package.json index 9a27bc1..62ec8d9 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "multicb": "^1.2.1", "pull-box-stream": "^1.0.12", "pull-cat": "^1.1.11", + "pull-catch": "^1.0.0", "pull-hyperscript": "^0.2.2", "pull-identify-filetype": "^1.1.0", "pull-paginate": "^1.0.0", -- cgit v1.2.3 From f752c762185f7493a5420f461bc8e766db84fc60 Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 8 Jan 2018 17:17:18 -1000 Subject: Render git diffs --- lib/serve.js | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++++- package-lock.json | 4 ++ package.json | 1 + static/styles.css | 3 + 4 files changed, 187 insertions(+), 2 deletions(-) (limited to 'package-lock.json') diff --git a/lib/serve.js b/lib/serve.js index f146c49..de2757e 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -23,6 +23,7 @@ var emojis = require('emoji-named-characters') var jpeg = require('jpeg-autorotate') var unzip = require('unzip') var Catch = require('pull-catch') +var Diff = require('diff') module.exports = Serve @@ -1648,6 +1649,7 @@ Serve.prototype.git = function (url) { case 'tree': return this.gitTree(m[2]) case 'blob': return this.gitBlob(m[2]) case 'raw': return this.gitRaw(m[2]) + case 'diff': return this.gitDiff(m[2]) default: return this.respond(404, 'Not found') } } @@ -1782,10 +1784,14 @@ Serve.prototype.gitCommit = function (rev) { pull.map(function (file) { return ph('tr', [ ph('td', ph('code', u.escapeHTML(file.name))), - // ph('td', ph('code', u.escapeHTML(JSON.stringify(file.msg)))), ph('td', file.deleted ? 'deleted' : file.created ? 'created' - : file.hash ? 'changed' + : file.hash ? + ph('a', {href: + self.app.render.toUrl('/git/diff/' + + file.hash[0] + '..' + file.hash[1] + + '?msg=' + encodeURIComponent(obj.msg.key)) + }, 'changed') : file.mode ? 'mode changed' : JSON.stringify(file)) ]) @@ -2016,6 +2022,177 @@ Serve.prototype.gitBlob = function (rev) { }) } +Serve.prototype.gitDiff = function (revs) { + var self = this + var parts = revs.split('..') + if (parts.length !== 2) return pull( + ph('div.error', 'revs should be ..'), + self.wrapPage('git diff'), + self.respondSink(400) + ) + var rev1 = parts[0] + var rev2 = parts[1] + if (!/[0-9a-f]{24}/.test(rev1)) return pull( + ph('div.error', 'rev 1 is not a git object id'), + self.wrapPage('git diff'), + self.respondSink(400) + ) + if (!/[0-9a-f]{24}/.test(rev2)) return pull( + ph('div.error', 'rev 2 is not a git object id'), + self.wrapPage('git diff'), + self.respondSink(400) + ) + + if (!u.isRef(self.query.msg)) return pull( + ph('div.error', 'missing message id'), + self.wrapPage('git diff'), + self.respondSink(400) + ) + + var done = multicb({pluck: 1, spread: true}) + // the msg qs param should point to the message for rev2 object. the msg for + // rev1 object we will have to look up. + self.app.git.getObjectMsg({ + obj: rev1, + headMsgId: self.query.msg, + type: 'blob', + }, done()) + self.getMsgDecryptedMaybeOoo(self.query.msg, done()) + done(function (err, msg1, msg2) { + if (err) return pull( + pull.once(u.renderError(err).outerHTML), + self.wrapPage('git diff ' + revs), + self.respondSink(400) + ) + var msg1Date = new Date(msg1.value.timestamp) + var msg2Date = new Date(msg2.value.timestamp) + var revsShort = rev1.substr(0, 8) + '..' + rev2.substr(0, 8) + pull( + ph('section', [ + ph('h3', ph('a', {href: ''}, revsShort)), + ph('div', [ + ph('a', { + href: self.app.render.toUrl('/git/blob/' + rev1 + '?msg=' + encodeURIComponent(msg1.key)) + }, rev1), ' ', + self.phIdLink(msg1.value.author), ' ', + ph('a', { + href: self.app.render.toUrl(msg1.key), + title: msg1Date.toLocaleString(), + }, htime(msg1Date)) + ]), + ph('div', [ + ph('a', { + href: self.app.render.toUrl('/git/blob/' + rev2 + '?msg=' + encodeURIComponent(msg2.key)) + }, rev2), ' ', + self.phIdLink(msg2.value.author), ' ', + ph('a', { + href: self.app.render.toUrl(msg2.key), + title: msg2Date.toLocaleString(), + }, htime(msg2Date)) + ]), + u.readNext(function (cb) { + var done = multicb({pluck: 1, spread: true}) + self.app.git.openObject({ + obj: rev1, + msg: msg1.key, + }, done()) + self.app.git.openObject({ + obj: rev2, + msg: msg2.key, + }, done()) + done(function (err, obj1, obj2) { + if (err && err.name === 'BlobNotFoundError') + return cb(null, self.askWantBlobsForm(err.links)) + if (err) return cb(err) + + var done = multicb({pluck: 1, spread: true}) + pull.collect(done())(self.app.git.readObject(obj1)) + pull.collect(done())(self.app.git.readObject(obj2)) + done(function (err, bufs1, bufs2) { + if (err) return cb(err) + var str1 = Buffer.concat(bufs1, obj1.length).toString('utf8') + var str2 = Buffer.concat(bufs2, obj2.length).toString('utf8') + var diff = Diff.structuredPatch('', '', str1, str2) + cb(null, self.gitDiffTable(diff)) + }) + }) + }) + ]), + self.wrapPage('git diff'), + self.respondSink(200) + ) + }) +} + +Serve.prototype.gitDiffTable = function (diff) { + var self = this + return pull( + ph('table', [ + ph('tr', [ + ]), + pull( + pull.values(diff.hunks), + pull.map(function (hunk) { + var oldLine = hunk.oldStart + var newLine = hunk.newStart + return [ + ph('tr', [ + ph('td', {colspan: 2}), + ph('td', ph('pre', + '@@ -' + oldLine + ',' + hunk.oldLines + ' ' + + '+' + newLine + ',' + hunk.newLines + ' @@')) + ]), + pull( + pull.values(hunk.lines), + pull.map(function (line) { + var s = line[0] + if (s == '\\') return + var html = self.app.render.highlight(line) + var lineNums = [s == '+' ? '' : oldLine++, s == '-' ? '' : newLine++] + // var id = [filename].concat(lineNums).join('-') + var newLineNum = lineNums[lineNums.length-1] + return ph('tr', { + class: s == '+' ? 'diff-new' : s == '-' ? 'diff-old' : '' + }, [ + lineNums.map(function (num, i) { + return ph('td', String(num)) + // TODO: allow linking to comments + /* + var idEnc = encodeURIComponent(id) + return '' + + (num ? '' + + num + '' + + (updateId && i === lineNums.length-1 && s !== '-' ? + ' ' + : '') + : '') + '' + } + */ + }), + ph('td', ph('pre', u.escapeHTML(html))) + ]) + + // TODO: line-comments + /* + (lineCommentThreads[newLineNum] ? + '' + + lineCommentThreads[newLineNum] + + '' + : commit && query.comment === id ? + '' + + forms.lineComment(req, repo, updateId, commit, filename, newLineNum) + + '' + : '') + */ + }) + ) + ] + }) + ) + ]) + ) +} + Serve.prototype.gitObjectLinks = function (headMsgId, type) { var self = this return paramap(function (id, cb) { diff --git a/package-lock.json b/package-lock.json index 8d381d4..3a9bf62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -180,6 +180,10 @@ "streamsearch": "0.1.2" } }, + "diff": { + "version": "3.3.1", + "resolved": "http://localhost:8989/blobs/get/&+6G9mvp4Q/5bujMKlbFdbrub2IXMPleXIqTqyyvY5Ww=.sha256" + }, "ed2curve": { "version": "0.1.4", "resolved": "http://localhost:8989/blobs/get/&X6VtEiGqSVFiIHAZAXFZXB5q9iUd3gULIU9c0xyynNo=.sha256", diff --git a/package.json b/package.json index 62ec8d9..65ae820 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "asyncmemo": "^1.1.0", "base64-url": "^2.0.0", "busboy": "^0.2.14", + "diff": "^3.3.1", "emoji-named-characters": "^1.0.2", "emoji-server": "^1.0.0", "hashlru": "^2.1.0", diff --git a/static/styles.css b/static/styles.css index c26cf59..b22074f 100644 --- a/static/styles.css +++ b/static/styles.css @@ -193,3 +193,6 @@ table.ssb-object td { .chess-square-dark { background-color: #ccc; } + +.diff-old { background-color: #ffe2dd; } +.diff-new { background-color: #d1ffd6; } -- cgit v1.2.3 From 52170b13bd7c8d5b248761354e13846f204df04a Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 9 Jan 2018 20:38:46 -1000 Subject: Support line comments on blobs as well as diffs --- lib/serve.js | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- package-lock.json | 20 ++++++++++++++-- package.json | 2 ++ 3 files changed, 87 insertions(+), 5 deletions(-) (limited to 'package-lock.json') diff --git a/lib/serve.js b/lib/serve.js index aaf558f..4923667 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -24,6 +24,8 @@ var jpeg = require('jpeg-autorotate') var unzip = require('unzip') var Catch = require('pull-catch') var Diff = require('diff') +var split = require('pull-split') +var utf8 = require('pull-utf8-decoder') module.exports = Serve @@ -2032,6 +2034,7 @@ Serve.prototype.gitBlob = function (rev) { missingBlobs ? self.askWantBlobsForm(missingBlobs) : pull( self.app.git.readObject(obj), self.wrapBinary({ + obj: obj, rawUrl: self.app.render.toUrl('/git/raw/' + rev + '?msg=' + encodeURIComponent(msg.key)), ext: self.query.ext @@ -2624,6 +2627,7 @@ Serve.prototype.zip = function (url) { Serve.prototype.wrapBinary = function (opts) { var self = this var ext = opts.ext + var hash = opts.obj.hash return function (read) { var readRendered, type read = ident(function (_ext) { @@ -2660,9 +2664,69 @@ Serve.prototype.wrapBinary = function (opts) { })(read) })) } - return ph('pre', pull.map(function (buf) { - return self.app.render.highlight(buf.toString('utf8'), ext) - })(read)) + var i = 0 + var updateMsg = opts.obj.msg + var commitId = self.query.commit + var filePath = self.query.path + var lineComments = opts.lineComments || {} + return u.readNext(function (cb) { + if (commitId && filePath) { + self.app.getLineComments({ + obj: opts.obj, + hash: hash, + }, gotLineComments) + } else { + gotLineComments(null, {}) + } + function gotLineComments(err, lineComments) { + if (err) return cb(err) + cb(null, ph('table', + pull( + read, + utf8(), + split(), + pull.map(function (line) { + var lineNum = i++ + var id = hash + '-' + lineNum + var idEnc = encodeURIComponent(id) + return [ + ph('tr', [ + ph('td', ph('a', { + name: id, + href: '?msg=' + encodeURIComponent(self.query.msg) + + '&commit=' + encodeURIComponent(self.query.commit) + + '&path=' + encodeURIComponent(self.query.path) + + '&comment=' + idEnc + + '#' + idEnc + }, String(lineNum))), + ph('td', ph('pre', self.app.render.highlight(line, ext))) + ]), + (lineComments[lineNum] ? + ph('tr', + ph('td', {colspan: 4}, + self.renderLineCommentThread(lineComments[lineNum], id) + ) + ) + : self.query.comment === id ? + ph('tr', + ph('td', {colspan: 4}, + self.renderLineCommentForm({ + id: id, + line: lineNum, + updateId: updateMsg.key, + repoId: updateMsg.value.content.repo, + commitId: commitId, + filePath: filePath, + }) + ) + ) + : '') + ] + }) + ) + )) + } + }) } } diff --git a/package-lock.json b/package-lock.json index 3a9bf62..905c326 100644 --- a/package-lock.json +++ b/package-lock.json @@ -182,7 +182,8 @@ }, "diff": { "version": "3.3.1", - "resolved": "http://localhost:8989/blobs/get/&+6G9mvp4Q/5bujMKlbFdbrub2IXMPleXIqTqyyvY5Ww=.sha256" + "resolved": "http://localhost:8989/blobs/get/&+6G9mvp4Q/5bujMKlbFdbrub2IXMPleXIqTqyyvY5Ww=.sha256", + "integrity": "sha1-qoVnpu7QPFMfyJ0/cRzQ5SWd7HU=" }, "ed2curve": { "version": "0.1.4", @@ -879,6 +880,14 @@ "resolved": "http://localhost:8989/blobs/get/&fFOPAd5Js7mJkEU4XHeJ6vE6H7nsTOegHpjY0hpTu00=.sha256", "integrity": "sha256-fFOPAd5Js7mJkEU4XHeJ6vE6H7nsTOegHpjY0hpTu00=" }, + "pull-split": { + "version": "0.2.0", + "resolved": "http://localhost:8989/blobs/get/&OWAh7XbI03yih8UH5Vu0qrYM6TGx0q8uah06dm22CJo=.sha256", + "integrity": "sha256-OWAh7XbI03yih8UH5Vu0qrYM6TGx0q8uah06dm22CJo=", + "requires": { + "pull-through": "1.0.18" + } + }, "pull-stream": { "version": "3.6.1", "resolved": "http://localhost:8989/blobs/get/&xEhoJll+9Z5EYr7s7MUgCbBhdF1nekcqnIdIKV4z2SU=.sha256", @@ -899,6 +908,11 @@ } } }, + "pull-utf8-decoder": { + "version": "1.0.2", + "resolved": "http://localhost:8989/blobs/get/&JHBdLm6x7Rsu08/eLVWYKq+YpGna4xnvqM44ucX2tpk=.sha256", + "integrity": "sha256-JHBdLm6x7Rsu08/eLVWYKq+YpGna4xnvqM44ucX2tpk=" + }, "pull-ws": { "version": "3.3.0", "resolved": "http://localhost:8989/blobs/get/&xe26a32xW10OFqKs+xdyUTSobJPCAGdnv7yIAjoqmlk=.sha256", @@ -1213,11 +1227,13 @@ "dependencies": { "is-valid-domain": { "version": "0.0.2", - "resolved": "http://localhost:8989/blobs/get/&phjiap+k1lGC5LPVba/w4Caomw5o0NQp2Hol+u/YAzE=.sha256" + "resolved": "http://localhost:8989/blobs/get/&phjiap+k1lGC5LPVba/w4Caomw5o0NQp2Hol+u/YAzE=.sha256", + "integrity": "sha1-PnqUI/98Oy/hFmOvvW04N6JR+3c=" }, "ssb-ref": { "version": "2.7.1", "resolved": "http://localhost:8989/blobs/get/&wLimOD3785KVj7kBIAbjN6GH8EMhKRkcZSPrEMhdhks=.sha256", + "integrity": "sha1-XU7/xUXsD/1/wVuieCmmQLiir7o=", "requires": { "ip": "1.1.5", "is-valid-domain": "0.0.2" diff --git a/package.json b/package.json index 65ae820..37d3ca4 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,9 @@ "pull-paginate": "^1.0.0", "pull-paramap": "^1.2.1", "pull-reader": "^1.2.9", + "pull-split": "^0.2.0", "pull-stream": "^3.5.0", + "pull-utf8-decoder": "^1.0.2", "ssb-client": "http://localhost:8989/blobs/get/&EAaUpI+wrJM5/ly1RqZW0GAEF4PmCAmABBj7e6UIrL0=.sha256", "ssb-contact": "^1.2.0", "ssb-git": "^0.6.0", -- cgit v1.2.3 From afc315b47e13e5a98eb37b9b56a0d36571d1c4a9 Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 9 Jan 2018 21:04:51 -1000 Subject: Update package-lock.json --- package-lock.json | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'package-lock.json') diff --git a/package-lock.json b/package-lock.json index 905c326..43d981e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -787,6 +787,13 @@ "version": "http://localhost:8989/blobs/get/&mDI2o/JC9yvFOVbeAhDN+hwTm7cK+dBwISYO49EMY24=.sha256", "integrity": "sha1-CIew/7MK8ypW2+z6csFnInHwexM=" }, + "pull-git-packidx-parser": { + "version": "1.0.0", + "resolved": "http://localhost:8989/blobs/get/&ou0MPQZabBgzrHDu54jzLU3Sc6Rf5a/lost0whPQUJ0=.sha256", + "requires": { + "pull-stream": "3.6.1" + } + }, "pull-goodbye": { "version": "0.0.2", "resolved": "http://localhost:8989/blobs/get/&MQhN9Pp3BYaj0TzxK39JfAK7CjVceg1EPfNhhFnZ9sU=.sha256", @@ -846,6 +853,14 @@ } } }, + "pull-kvdiff": { + "version": "0.0.1", + "resolved": "http://localhost:8989/blobs/get/&xxfT88LrbK4FSIhpaNmIAt4jzsaBgVugeaDPVwC1gCU=.sha256", + "integrity": "sha256-xxfT88LrbK4FSIhpaNmIAt4jzsaBgVugeaDPVwC1gCU=", + "requires": { + "multicb": "1.2.2" + } + }, "pull-many": { "version": "http://localhost:8989/blobs/get/&wBHfPheBEjwjjkNoeM5mWtU/tYDs8+xnt5w6C1+EK3g=.sha256", "integrity": "sha1-Pa3ZttFWxUVyG9qNAAPdjqoGKT4=", @@ -1203,6 +1218,23 @@ "pull-stream": "3.6.1" } }, + "ssb-git": { + "version": "0.6.0", + "resolved": "http://localhost:8989/blobs/get/&tz2WDecaYFjrKmRdZmLW9hu1DF7oYD+rNzAzaObqF5I=.sha256", + "integrity": "sha256-tz2WDecaYFjrKmRdZmLW9hu1DF7oYD+rNzAzaObqF5I=", + "requires": { + "asyncmemo": "1.1.0", + "hashlru": "http://localhost:8989/blobs/get/&EASZ1/L+jHuTVxrgbQrNlTdCenA8etAVuk/TGn92RoY=.sha256", + "looper": "4.0.0", + "multicb": "1.2.2", + "pull-git-packidx-parser": "1.0.0", + "pull-kvdiff": "0.0.1", + "pull-paramap": "1.2.2", + "pull-reader": "1.2.9", + "pull-stream": "3.6.1", + "stream-to-pull-stream": "1.7.2" + } + }, "ssb-keys": { "version": "7.0.10", "resolved": "http://localhost:8989/blobs/get/&/XLsWirGsUv3pQ11HIJwzZgLF7HVKQmd4QCt+nCDf6A=.sha256", -- cgit v1.2.3 From 7052ddce7a33724467c076dff4217c73001d4a8c Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 9 Jan 2018 22:02:17 -1000 Subject: Use correct message ids in commit file diff links --- lib/serve.js | 5 +++-- package-lock.json | 6 +++--- package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'package-lock.json') diff --git a/lib/serve.js b/lib/serve.js index 5ba0004..793ad84 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -1799,6 +1799,7 @@ Serve.prototype.gitCommit = function (rev) { ph('table', pull( self.app.git.readCommitChanges(commit), pull.map(function (file) { + var msg = file.msg || obj.msg return ph('tr', [ ph('td', ph('code', u.escapeHTML(file.name))), ph('td', file.deleted ? 'deleted' @@ -1806,13 +1807,13 @@ Serve.prototype.gitCommit = function (rev) { ph('a', {href: self.app.render.toUrl('/git/blob/' + (file.hash[1] || file.hash[0]) - + '?msg=' + encodeURIComponent(obj.msg.key)) + + '?msg=' + encodeURIComponent(msg.key)) }, 'created') : file.hash ? ph('a', {href: self.app.render.toUrl('/git/diff/' + file.hash[0] + '..' + file.hash[1] - + '?msg=' + encodeURIComponent(obj.msg.key)) + + '?msg=' + encodeURIComponent(msg.key)) + '&commit=' + rev + '&path=' + encodeURIComponent(file.name) }, 'changed') diff --git a/package-lock.json b/package-lock.json index 43d981e..8533e05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1219,9 +1219,9 @@ } }, "ssb-git": { - "version": "0.6.0", - "resolved": "http://localhost:8989/blobs/get/&tz2WDecaYFjrKmRdZmLW9hu1DF7oYD+rNzAzaObqF5I=.sha256", - "integrity": "sha256-tz2WDecaYFjrKmRdZmLW9hu1DF7oYD+rNzAzaObqF5I=", + "version": "0.7.0", + "resolved": "http://localhost:8989/blobs/get/&YaFMXaoXkA4IA5A2FkfPJ/u+8k+3k6MLuDm09yeShdg=.sha256", + "integrity": "sha256-YaFMXaoXkA4IA5A2FkfPJ/u+8k+3k6MLuDm09yeShdg=", "requires": { "asyncmemo": "1.1.0", "hashlru": "http://localhost:8989/blobs/get/&EASZ1/L+jHuTVxrgbQrNlTdCenA8etAVuk/TGn92RoY=.sha256", diff --git a/package.json b/package.json index 37d3ca4..7c04857 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "pull-utf8-decoder": "^1.0.2", "ssb-client": "http://localhost:8989/blobs/get/&EAaUpI+wrJM5/ly1RqZW0GAEF4PmCAmABBj7e6UIrL0=.sha256", "ssb-contact": "^1.2.0", - "ssb-git": "^0.6.0", + "ssb-git": "^0.7.0", "ssb-marked": "^0.7.1", "ssb-mentions": "http://localhost:8989/blobs/get/&GjuxknqKwJqHznKueFNCyIh52v1woz5PB41vqmoHfyM=.sha256", "ssb-sort": "^1.0.0", -- cgit v1.2.3