gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commited091d44ed091d44Merge branch 'records' into mainTicketsed091d44/tools/sync-components.sh

2.2 KB

  1. #!/usr/bin/env bash
  2. # tools/sync-components.sh — copy the components.hybriel.worldapi.org blocks tickets uses, BYTE-VERBATIM from a commit
  3. # (mission 016; the model is layouts.worldapi.org's tools/sync-components.sh).
  4. # tools/sync-components.sh [commit] copy from <commit> (default: HEAD of the source repo), write components/SOURCE
  5. # tools/sync-components.sh --check compare the copies with the commit in components/SOURCE (exit 1 on any difference)
  6. # Source repo: $COMPONENTS_REPO (default loreana /media/STORAGE/projects/WorldAPI/components.hybriel.worldapi.org). The files come out of
  7. # git (`git show <commit>:<path>`), not the working tree, so uncommitted edits there never land here. Never edit the copies:
  8. # change them in components.hybriel, commit there, run this, then the gates (README "Comments").
  9. set -euo pipefail
  10. APP="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
  11. SRC="${COMPONENTS_REPO:-/media/STORAGE/projects/WorldAPI/components.hybriel.worldapi.org}"
  12. # what is copied: each block's own file + README (no demo.hl). comments.hl imports ../md-editor/md-editor.hl and (mission 017,
  13. # attachments) ../files-upload/files-upload.hl; md-editor and files-upload import ../icons/icons.hl (F4, the shared Icon).
  14. FILES=(
  15. comments/comments.hl comments/README.md
  16. md-editor/md-editor.hl md-editor/README.md
  17. icons/icons.hl icons/README.md
  18. files-upload/files-upload.hl files-upload/README.md
  19. )
  20. # a git worktree has a .git FILE, a clone a .git directory: either is a repo
  21. [ -e "$SRC/.git" ] || { echo "no git repo at $SRC (set COMPONENTS_REPO)"; exit 2; }
  22. if [ "${1:-}" = "--check" ]; then
  23. REF="$(head -n1 "$APP/components/SOURCE" | cut -d' ' -f1)"
  24. bad=0
  25. for f in "${FILES[@]}"; do
  26. if ! git -C "$SRC" show "$REF:components/$f" | cmp -s - "$APP/components/$f"; then echo "DIFFERS: components/$f (vs $REF)"; bad=1; fi
  27. done
  28. [ $bad = 0 ] && echo "verbatim: ${#FILES[@]} files = components.hybriel $REF"
  29. exit $bad
  30. fi
  31. REF="$(git -C "$SRC" rev-parse --short "${1:-HEAD}^{commit}")"
  32. for f in "${FILES[@]}"; do
  33. mkdir -p "$APP/components/$(dirname "$f")"
  34. git -C "$SRC" show "$REF:components/$f" > "$APP/components/$f"
  35. done
  36. echo "$REF $(git -C "$SRC" log -1 --format='%cs %s' "$REF")" > "$APP/components/SOURCE"
  37. echo "copied ${#FILES[@]} files from components.hybriel $REF"
  38. "$0" --check

Branches

Latest commits

  • ed091d44Merge branch 'records' into mainTickets
  • 180c0cdb|||PR records: ticket move live (M32), hybriel#439mre
  • 497cae7bMerge branch 'm32-move' into mainTickets
  • 772e0696|||PR Allow project admins to move tickets between their projectsmre
  • be92a560Merge branch 'records' into mainTickets
  • 0daf2ea8|||PR records: PR-only workflow, #50 donemre
  • 0185d0b6Log PR 1 deploymre
  • f5bf16e2Mission 031: deploy PR 1mre
  • c69cd5f3Merge branch 'pr-flow' into mainTickets
  • cc56798cLog gitoria PR-only requestmre
  • d876d0b2|||PR README: changes land as PRsmre
  • fd83ac1fconductor: caramboleyo is the user, not owner/creatorApollo
  • 3b858c91Log backup hard-link fixmre
  • 7f6b37a0deploy.sh backup: tar --hard-dereference (hard links broke mpackdb sidecars on restore)mre
  • e93711d9Log E30 livemre
  • 59c02e4dMerge e30: preserve edited state note labels in Markdownmre
  • 30970796Log E30 deploy GOmre
  • 7c8e6d83Limit edited state note fix to Markdown renderingmre
  • 910536d0Log E30 reviewmre
  • 36984386Preserve state transitions when their notes are editedmre