Debug on, give me surfeit of it

This commit is contained in:
Jack Jackson 2025-03-05 18:40:26 -08:00
parent e0f735e47a
commit 49ea6812ad
7 changed files with 8 additions and 0 deletions

4
dist/index.js vendored
View File

@ -25924,9 +25924,11 @@ async function main(sourceRepoId, targetRepoId, dryRun, tokenForTargetRepo) {
// only been alive so many years - there's a hard limit on the rate of code I could possibly have generated, which
// is small compared to, y'know, _companies_. And I don't see organizations of that size caring about GitHub
// contribution history at whole-org scale - and if they do, it'd be proportionally simple for them to implement it.
console.log(`DEBUG - getting source commit history`);
const sourceCommitHistory = (0, git_1.getNLatestCommits)(SOURCE_DIR, 10);
// Calling `doSomethingTo(sourceCommitHistory.reverse()); doSomethingElseTo(sourceCommitHistory.reverse());` results
// in the second invocation receiving the double-reversed array.
console.log(`DEBUG - reversing source commit history`);
const reversedSourceCommitHistory = sourceCommitHistory.reverse();
// Only have to go back far enough in target history to find the commit that immediately precedes the oldest
// commit in source history
@ -25936,7 +25938,9 @@ async function main(sourceRepoId, targetRepoId, dryRun, tokenForTargetRepo) {
// than abandoning the target tree after the insertion point and trusting in later operation to rebuild it - because
// the target repo's tree will have representations of commits from _other_ (source)repos too, which we cannot
// recreate without their context)
console.log(`DEBUG - getting target commit history`);
let targetCommitHistory = (0, git_1.getCommitsSinceLatestBeforeGivenDate)(TARGET_DIR, reversedSourceCommitHistory[0].date);
console.log(`DEBUG - iterating over source commit history`);
for (const sourceCommit of reversedSourceCommitHistory) {
// "(Index of) First Target Commit that is earlier than (or equal to) the source commit"
const targetCommitIndex = targetCommitHistory.findIndex(c => c.date <= sourceCommit.date);

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -29,10 +29,12 @@ export async function main(sourceRepoId: RepoId, targetRepoId: RepoId, dryRun: b
// only been alive so many years - there's a hard limit on the rate of code I could possibly have generated, which
// is small compared to, y'know, _companies_. And I don't see organizations of that size caring about GitHub
// contribution history at whole-org scale - and if they do, it'd be proportionally simple for them to implement it.
console.log(`DEBUG - getting source commit history`);
const sourceCommitHistory = getNLatestCommits(SOURCE_DIR, 10);
// Calling `doSomethingTo(sourceCommitHistory.reverse()); doSomethingElseTo(sourceCommitHistory.reverse());` results
// in the second invocation receiving the double-reversed array.
console.log(`DEBUG - reversing source commit history`);
const reversedSourceCommitHistory = sourceCommitHistory.reverse();
// Only have to go back far enough in target history to find the commit that immediately precedes the oldest
// commit in source history
@ -42,8 +44,10 @@ export async function main(sourceRepoId: RepoId, targetRepoId: RepoId, dryRun: b
// than abandoning the target tree after the insertion point and trusting in later operation to rebuild it - because
// the target repo's tree will have representations of commits from _other_ (source)repos too, which we cannot
// recreate without their context)
console.log(`DEBUG - getting target commit history`);
let targetCommitHistory = getCommitsSinceLatestBeforeGivenDate(TARGET_DIR, reversedSourceCommitHistory[0].date);
console.log(`DEBUG - iterating over source commit history`);
for (const sourceCommit of reversedSourceCommitHistory) {
// "(Index of) First Target Commit that is earlier than (or equal to) the source commit"
const targetCommitIndex = targetCommitHistory.findIndex(c => c.date <= sourceCommit.date);