Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sovereign-intelligence/blob/main/tests/forkpush/expected.sh # sovereign-intelligence Front door to Drake Stapleton's sovereign stack. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `sovereign-intelligence / tests / forkpush / expected.sh` 75 lines ยท 3042 bytes Raw Blame History 1 #!/bin/sh 2 # fork-push: push the fork-only branches of my personal GitHub forks to their Radicle projects. 3 # Generated by tools/forkpush.om from stack/FORKS.tsv; do not edit by hand. 4 # 5 # For every stack/FORKS.tsv row whose action is radicle, it fetches the branch from 6 # https://github.com// into a Radicle working copy of the project, checks that the 7 # fetched commit is the head the manifest names, and only then pushes it to Radicle as 8 # fork/. Rows kept private and rows already in this repository are listed below as 9 # comments and are never fetched or pushed. 10 # 11 # Needs git, and rad authenticated as the project's delegate with its node running 12 # (rad auth, rad node start). It refuses to run as root. 13 # FP_DIR=path the one directory it creates and works in (default ./fork-push); each project 14 # is cloned there once, into a directory named after its RID without rad: 15 # Exit status: 0 every branch OK, 2 a fetched commit is not the manifest head, 16 # 3 a clone, fetch or push failed (3 wins over 2). 17 # Manifest: 3 to push to Radicle, 1 kept private, 1 in this repository. 18 19 set -eu 20 umask 022 21 22 FP_DIR="${FP_DIR:-./fork-push}" 23 fp_say() { printf '%s\n' "$*"; } 24 fp_die() { printf 'fork-push: %s\n' "$*" >&2; exit 1; } 25 26 if [ "$(id -u)" = "0" ]; then fp_die "refusing to run as root; run it as your own user"; fi 27 command -v git >/dev/null 2>&1 || fp_die "git is required: https://git-scm.com" 28 command -v rad >/dev/null 2>&1 || fp_die "rad is required: https://radicle.xyz" 29 mkdir -p -- "$FP_DIR" 30 cd -- "$FP_DIR" 31 fp_ok=0 32 fp_bad=0 33 fp_fail=0 34 35 fp() { 36 fp_d="${1#rad:}" 37 if [ ! -d "$fp_d" ]; then 38 if ! rad clone "$1" "$fp_d" /dev/null || true)" 51 if [ "$fp_got" != "$4" ]; then 52 fp_say "MISMATCH $1 fork/$3 manifest $4, fetched ${fp_got:-none}" 53 fp_bad=$((fp_bad + 1)) 54 return 0 55 fi 56 if git -C "$fp_d" push --quiet rad "refs/heads/fork/$3:refs/heads/fork/$3"