From 4b3bde91be027e73a512046415b0ec1c8e0b92eb Mon Sep 17 00:00:00 2001 From: bjornbjornsson Date: Mon, 28 Feb 2022 14:41:40 -0500 Subject: [PATCH 1/2] Improve logging to list unconverted ancestors of given commit SHA Previously, stitch_util.js was logging the message `listing all unconverted ancestors of {commit_sha}`, but the unconverted ancestors weren't actually being logged. This PR puts the unconverted ancestors in the log and also logs how many unconverted ancestors there are. --- node/lib/util/stitch_util.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node/lib/util/stitch_util.js b/node/lib/util/stitch_util.js index 58d91324..901b790e 100644 --- a/node/lib/util/stitch_util.js +++ b/node/lib/util/stitch_util.js @@ -873,6 +873,8 @@ exports.listCommitsToStitch = co.wrap(function *(repo, } const commitShas = exports.listCommitsInOrder(commit.id().tostrS(), allParents); + console.log(`listing all ${commitShas.length} unconverted ancestors of ` + + `${commit.id.tostrS()}: ${commitShas}`); return commitShas.map(sha => commitMap[sha]); }); From 46f2582013372761ace33bd9af9216821b9e1d4f Mon Sep 17 00:00:00 2001 From: bjornbjornsson Date: Thu, 24 Mar 2022 17:46:42 -0400 Subject: [PATCH 2/2] Address suggestions Shorten commit SHAs; truncate the message if it's over 1000 characters --- node/lib/util/stitch_util.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/node/lib/util/stitch_util.js b/node/lib/util/stitch_util.js index 901b790e..67266bb9 100644 --- a/node/lib/util/stitch_util.js +++ b/node/lib/util/stitch_util.js @@ -873,8 +873,18 @@ exports.listCommitsToStitch = co.wrap(function *(repo, } const commitShas = exports.listCommitsInOrder(commit.id().tostrS(), allParents); + const shortCommitShas = []; + for (const commitSha of commitShas) { + shortCommitShas.push(commitSha.slice(0,7)); + } + shortCommitShasMessage = shortCommitShas.join(", "); + if (shortCommitShasMessage.length > 1000) { + shortCommitShasMessage = shortCommitShasMessage.slice(0,1000); + shortCommitShasMessage.concat(`[Message too long and was ` + + `truncated to 1000 characters]`); + } console.log(`listing all ${commitShas.length} unconverted ancestors of ` + - `${commit.id.tostrS()}: ${commitShas}`); + `${commit.id.tostrS()}: ${shortCommitShasMessage}`); return commitShas.map(sha => commitMap[sha]); });