2.5 KiB
2.5 KiB
name, description
| name | description |
|---|---|
| repo-sync | Batch-sync all readable repos of a chosen Gitea owner into the working directory. List owners, let the user pick, then clone or update each repo through tools/repo-sync.sh; a repo reported dirty goes to jsc-git:pr against the base branch that same script reports. Use for workspace bootstrap or bulk refresh; not for a single repo. |
repo-sync — batch-sync repositories
Steps
- Before calling
tools/gitea.sh, resolveGITEA_HOSTandGITEA_TOKENfrom the current shell environment (also checktea login listfor a usable login token whenGITEA_TOKENis unset). IfGITEA_HOSTis unresolvable, orGITEA_TOKENis unset and no tea login token exists either, ask the user for the missing value per thejsc-ask:askrules before proceeding to anytools/gitea.shcall. Done whenGITEA_HOSTholds a value and eitherGITEA_TOKENor a tea login token is available. - Run
tools/gitea.sh ownersto list every{owner}the user can read. Done when the command has printed at least one{owner}. - Ask the user which
{owner}to sync, per thejsc-ask:askrules. Every option states the owner's repo count and impact scope. Done when the user has named exactly one{owner}from that list. - Run
tools/gitea.sh repos {owner}to list every readable{repo}under that owner. Done when the command has printed the full{owner}/{repo}list for the chosen owner. - Sync each
{repo}one by one. This step MUST run as a sub agent (one sub agent per repo):- Run
tools/repo-sync.sh {owner}/{repo}. The script owns the clone-versus-pull decision and the base-branch precedence, so run nogit clone,git checkoutorgit pullby hand, and derive no branch name yourself. Route on its single line of output:clonedorupdated→ this repo is done;dirty {branch}→ go to substep 2;failed {reason}→ record that reason and stop this repo. Done when exactly one of those four outcomes is recorded for this repo. dirty {branch}→ calljsc-git:prwith{branch}from that same output line as the base, passed through verbatim. It commits, branches, pushes and opens the PR itself, so add none of those steps. Done whenjsc-git:prreturns the PR URL and reports it with the table format injsc-meta/references/pr-report.md.
- Run
- Report the sync result for every repo: cloned, updated, PR table row, or the failure reason. Done when every
{repo}from step 4 carries one of those four results, and all PR rows share one table when more than one PR exists.