Recreate target commit history after inserting-after-HEAD
This commit is contained in:
parent
c13ece3f65
commit
7e843c59e7
26
.gitea/workflows/main.yml
Normal file
26
.gitea/workflows/main.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# I Am A Strange Loop
|
||||||
|
name: Mirror to GitHub
|
||||||
|
run-name: Mirror to GitHub
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# If I were going to make this as a template, I'd instead use the `${{ github.[...] }} context to determin owner
|
||||||
|
# and name directly from the context.
|
||||||
|
# I'm leaving that off because it'd require a whole other step (to pipe `github.repository` through a splitting
|
||||||
|
# tool, because there's only `github.repository_owner`, no `github.repository_name`)
|
||||||
|
#
|
||||||
|
# (And the token should be retrieved from Vault)
|
||||||
|
# Using `github.ref` just in case there's any race condition ambiguity.
|
||||||
|
- uses: https://gitea.scubbo.org/scubbo/commit-report-sync@${{ github.ref}}
|
||||||
|
with:
|
||||||
|
target_repo_domain: github.com
|
||||||
|
target_repo_owner: scubbo
|
||||||
|
target_repo_name: gitea-commit-mirror
|
||||||
|
source_repo_domain: gitea.scubbo.org
|
||||||
|
source_repo_owner: scubbo
|
||||||
|
source_repo_name: commit-report-sync
|
||||||
|
token_for_target_repo: ${{ secrets.PAT_FOR_GITHUB_SYNC }}
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
!node_modules/
|
!node_modules/
|
||||||
!dist/
|
!dist/
|
||||||
|
!.gitea/
|
||||||
working/
|
working/
|
||||||
|
|
||||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -25838,6 +25838,8 @@ async function main(sourceRepo, targetRepo, dryRun, tokenForTargetRepo) {
|
|||||||
else {
|
else {
|
||||||
console.log(`DEBUG - could not find a targetCommit that is earlier than or equal to the sourceCommit ${sourceCommit.hash} - therefore, writing the source commit's representation onto the current HEAD of target repo`);
|
console.log(`DEBUG - could not find a targetCommit that is earlier than or equal to the sourceCommit ${sourceCommit.hash} - therefore, writing the source commit's representation onto the current HEAD of target repo`);
|
||||||
insertRepresentativeCommit(sourceRepo, sourceCommit, undefined, undefined);
|
insertRepresentativeCommit(sourceRepo, sourceCommit, undefined, undefined);
|
||||||
|
// As above, have to regenerate history after mutation
|
||||||
|
targetCommitHistory = buildTargetCommitHistory(TARGET_DIR, sourceCommit.date);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// OK, that's it - we've processed all the source commits, and we've inserted all the necessary target commits.
|
// OK, that's it - we've processed all the source commits, and we've inserted all the necessary target commits.
|
||||||
|
BIN
node_modules/@vercel/ncc/dist/ncc/cli.js.cache
generated
vendored
BIN
node_modules/@vercel/ncc/dist/ncc/cli.js.cache
generated
vendored
Binary file not shown.
BIN
node_modules/@vercel/ncc/dist/ncc/index.js.cache
generated
vendored
BIN
node_modules/@vercel/ncc/dist/ncc/index.js.cache
generated
vendored
Binary file not shown.
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache
generated
vendored
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache
generated
vendored
Binary file not shown.
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache
generated
vendored
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache
generated
vendored
Binary file not shown.
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache
generated
vendored
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache
generated
vendored
Binary file not shown.
@ -110,8 +110,9 @@ export async function main(sourceRepo: Repo, targetRepo: Repo, dryRun: boolean,
|
|||||||
} else {
|
} else {
|
||||||
console.log(`DEBUG - could not find a targetCommit that is earlier than or equal to the sourceCommit ${sourceCommit.hash} - therefore, writing the source commit's representation onto the current HEAD of target repo`);
|
console.log(`DEBUG - could not find a targetCommit that is earlier than or equal to the sourceCommit ${sourceCommit.hash} - therefore, writing the source commit's representation onto the current HEAD of target repo`);
|
||||||
insertRepresentativeCommit(sourceRepo, sourceCommit, undefined, undefined);
|
insertRepresentativeCommit(sourceRepo, sourceCommit, undefined, undefined);
|
||||||
|
// As above, have to regenerate history after mutation
|
||||||
|
targetCommitHistory = buildTargetCommitHistory(TARGET_DIR, sourceCommit.date);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// OK, that's it - we've processed all the source commits, and we've inserted all the necessary target commits.
|
// OK, that's it - we've processed all the source commits, and we've inserted all the necessary target commits.
|
||||||
// We can just `git push` to the target repo now.
|
// We can just `git push` to the target repo now.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user