Set User email and Name

This commit is contained in:
Jack Jackson 2025-03-01 22:57:24 -08:00
parent 38f409e8ce
commit af8aa50f6b
7 changed files with 8 additions and 1 deletions

4
dist/index.js vendored
View File

@ -25754,6 +25754,10 @@ async function main(sourceRepo, targetRepo, dryRun) {
console.log(`DEBUG - sourceRepoCloneCommand: ${sourceRepoCloneCommand}`);
(0, child_process_1.execSync)(sourceRepoCloneCommand);
(0, child_process_1.execSync)(`git clone https://${(0, types_1.repoString)(targetRepo)} ${TARGET_DIR}`);
// Seems like setting `--author` on `git commit` is not sufficient - still need to set `user` as well (I guess those
// are the difference between `comitted by` and `written by`?)
(0, child_process_1.execSync)(`git config --global user.email "commit-report-sync-bot@scubbo.org"`, { cwd: TARGET_DIR });
(0, child_process_1.execSync)(`git config --global user.name "Commit Report Sync Bot"`, { cwd: TARGET_DIR });
// Logic:
// * Go back as far in source commit history as the given number of commits
// * For each commit, check if it is recorded in the target repo

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -28,6 +28,10 @@ export async function main(sourceRepo: Repo, targetRepo: Repo, dryRun: boolean)
console.log(`DEBUG - sourceRepoCloneCommand: ${sourceRepoCloneCommand}`);
execSync(sourceRepoCloneCommand);
execSync(`git clone https://${repoString(targetRepo)} ${TARGET_DIR}`);
// Seems like setting `--author` on `git commit` is not sufficient - still need to set `user` as well (I guess those
// are the difference between `comitted by` and `written by`?)
execSync(`git config --global user.email "commit-report-sync-bot@scubbo.org"`, { cwd: TARGET_DIR });
execSync(`git config --global user.name "Commit Report Sync Bot"`, { cwd: TARGET_DIR });
// Logic:
// * Go back as far in source commit history as the given number of commits
@ -49,7 +53,6 @@ export async function main(sourceRepo: Repo, targetRepo: Repo, dryRun: boolean)
// 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.
const sourceCommitHistory = buildSourceCommitHistory(SOURCE_DIR, 10);
// Calling `doSomethingTo(sourceCommitHistory.reverse()); doSomethingElseTo(sourceCommitHistory.reverse());` results