Tucker McKnight
[WIP] add ahead/behind commit count for branches. Something is currently broken here.
317
317
console.log(flatFilesData.filter(entry => entry.file.includes('njk')))
117
117
branches.forEach((branch) => {
const branchDescription = branchesToAdd.find(branchToAdd => branchToAdd.name === branch.name)
const compareTo = branchDescription.compareTo || reposConfig.repos[repoName].defaultBranch
const compareToBranch = branches.find((test) => test.name = compareTo)
const compareToBranchCommits = new Set()
let currentCommit = commits.get(compareToBranch.head)
while (currentCommit !== undefined) {
compareToBranchCommits.add(currentCommit.hash)
currentCommit = commits.get(currentCommit.parent)
}
const thisBranchCommits = new Set()
currentCommit = commits.get(branch.head)
while (currentCommit !== undefined) {
thisBranchCommits.add(currentCommit.hash)
currentCommit = commits.get(currentCommit.parent)
}
// At this point, we have all commits in the compareTo branch in one set, and
// all commits from this branch in another set.
const onlyInThisBranch = thisBranchCommits.difference(compareToBranchCommits).size
const onlyInCompareToBranch = compareToBranchCommits.difference(thisBranchCommits).size
branch['ahead'] = onlyInThisBranch
branch['behind'] = onlyInCompareToBranch
branch['compareTo'] = compareTo
})
9
9
if (branchName === 'main') {
console.log(files)
}
6
"lib": ["es2023", "dom"],
6
"lib": ["esnext", "dom"],