chore(bisect): properly output bisect ranges + output styling (#3523)
A bit more colors ![image](https://user-images.githubusercontent.com/746130/48240497-d1845180-e387-11e8-9bac-dcde29ef967e.png)
This commit is contained in:
parent
576c8f84e7
commit
1d671c69a3
@ -91,14 +91,23 @@ if (!fs.existsSync(scriptPath)) {
|
|||||||
outcome = COLOR_GREEN + 'GOOD' + COLOR_RESET;
|
outcome = COLOR_GREEN + 'GOOD' + COLOR_RESET;
|
||||||
}
|
}
|
||||||
const span = Math.abs(good - bad);
|
const span = Math.abs(good - bad);
|
||||||
console.log(`- ${COLOR_YELLOW}r${revision}${COLOR_RESET} was ${outcome}. Bisecting [${good}, ${bad}] - ${COLOR_YELLOW}${span}${COLOR_RESET} revisions and ${COLOR_YELLOW}~${span.toString(2).length}${COLOR_RESET} iterations`);
|
let fromText = '';
|
||||||
|
let toText = '';
|
||||||
|
if (good < bad) {
|
||||||
|
fromText = COLOR_GREEN + good + COLOR_RESET;
|
||||||
|
toText = COLOR_RED + bad + COLOR_RESET;
|
||||||
|
} else {
|
||||||
|
fromText = COLOR_RED + bad + COLOR_RESET;
|
||||||
|
toText = COLOR_GREEN + good + COLOR_RESET;
|
||||||
|
}
|
||||||
|
console.log(`- ${COLOR_YELLOW}r${revision}${COLOR_RESET} was ${outcome}. Bisecting [${fromText}, ${toText}] - ${COLOR_YELLOW}${span}${COLOR_RESET} revisions and ${COLOR_YELLOW}~${span.toString(2).length}${COLOR_RESET} iterations`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const [goodSha, badSha] = await Promise.all([
|
const [fromSha, toSha] = await Promise.all([
|
||||||
revisionToSha(good),
|
revisionToSha(Math.min(good, bad)),
|
||||||
revisionToSha(bad),
|
revisionToSha(Math.max(good, bad)),
|
||||||
]);
|
]);
|
||||||
console.log(`RANGE: https://chromium.googlesource.com/chromium/src/+log/${goodSha}..${badSha}`);
|
console.log(`RANGE: https://chromium.googlesource.com/chromium/src/+log/${fromSha}..${toSha}`);
|
||||||
})(scriptPath, argv.good, argv.bad);
|
})(scriptPath, argv.good, argv.bad);
|
||||||
|
|
||||||
function runScript(scriptPath, revisionInfo) {
|
function runScript(scriptPath, revisionInfo) {
|
||||||
|
Loading…
Reference in New Issue
Block a user