gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit8c8ba2f18c8ba2f1log: PR flow announcedmre8c8ba2f1/components/addcode.hl

3.2 KB

  1. // components/addcode.hl — "ADD CODE TO THIS REPOSITORY" (gitoria#7, gitoria#20): the clone address and the exact git commands, for a
  2. // new folder and for an existing one; plain text on the Code tab (code, branch, commit pages) while nothing is pushed yet. The
  3. // password is an access token (main page). Shown only for an EXISTING, EMPTY repo; never on Readme / Pull requests / Releases /
  4. // Tickets / Settings (those pages don't use it). It is the page's own (inside the repo level's slot), so it is read fresh on
  5. // every navigation.
  6. import { NL, publicUrl, hostOnly, cloneOrigin } from '../lib/util.hl'
  7. import { slugOfRequest } from '../lib/orgs.hl'
  8. import { repoAt } from '../lib/repos.hl'
  9. import { isEmptyNow } from '../lib/git.hl'
  10. import { sshEnabled, sshUrl } from '../lib/sshkeys.hl'
  11. host = null
  12. orepo = ''
  13. session = null
  14. slug = slugOfRequest(host, orepo)
  15. repo = repoAt(slug, session)
  16. cloneUrl = repo != null ? cloneOrigin(slug) : ''
  17. tokensHref = publicUrl + '/#tokens'
  18. sshKeysHref = publicUrl + '/#sshkeys'
  19. showAddCode = repo != null && isEmptyNow(slug)
  20. newCommands = 'echo "# ' + slug + '" >> README.md' + NL + 'git init -b main' + NL + 'git add README.md' + NL + 'git commit -m "first commit"' + NL + 'git remote add origin ' + cloneUrl + NL + 'git push -u origin main'
  21. existingCommands = 'git remote add origin ' + cloneUrl + NL + 'git branch -M main' + NL + 'git push -u origin main'
  22. cloneCommand = 'git clone ' + cloneUrl
  23. // SSH (only when the sshd container is set up, sshkeys.hl): the same commands with the ssh address; the key comes from the main page
  24. showSsh = sshEnabled && repo != null
  25. sshAddress = repo != null ? sshUrl(hostOnly, repo.slug) : ''
  26. sshCloneCommand = 'git clone ' + sshAddress
  27. sshCommands = 'git remote add origin ' + sshAddress + NL + 'git push -u origin main'
  28. View {
  29. if (showAddCode) {
  30. addCode { id = "addcode"
  31. h2 { "Add code to this repository" }
  32. h2 { "Clone it" }
  33. pre { id = "clonecommand" cloneCommand }
  34. h2 { "Push a new project" }
  35. pre { id = "newcommands" newCommands }
  36. h2 { "Push an existing project" }
  37. pre { id = "existingcommands" existingCommands }
  38. if (showSsh) {
  39. h2 { "Or over SSH" }
  40. pre { id = "sshclonecommand" sshCloneCommand }
  41. pre { id = "sshcommands" sshCommands }
  42. p { class = "muted" "Add your public key under " a { id = "tosshkeys" href = sshKeysHref "SSH keys" } " on the main page after you log in; only the owner can push." }
  43. }
  44. p { class = "muted" "Reading needs no login. To push you must be the owner of this repository: git asks for a user name (anything) and a password — that is an access token, made under " a { id = "totokens" href = tokensHref "Access tokens" } " on the main page after you log in." }
  45. }
  46. }
  47. }
  48. Style {
  49. #addcode {
  50. display = 'grid'
  51. gap = '.5rem'
  52. minWidth = '0'
  53. padding = '1rem'
  54. background = 'var(--color-surface)'
  55. borderRadius = 'var(--radius-large)'
  56. // Direct-child universal selectors have no bare language form.
  57. '> *' {
  58. margin = '0'
  59. }
  60. pre {
  61. margin = '0'
  62. padding = '.6rem .8rem'
  63. overflowX = 'auto'
  64. font = '.875rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'
  65. color = 'var(--color-text-strong)'
  66. background = 'var(--color-background-sunken)'
  67. borderRadius = 'var(--radius-large)'
  68. whiteSpace = 'pre-wrap'
  69. overflowWrap = 'anywhere'
  70. }
  71. }
  72. }

Branches

Latest commits

  • 8c8ba2f1log: PR flow announcedmre
  • fa00cd35log: Kunibert pings provenmre
  • 3a68cfaclog: components decisionmre
  • 87de8e31log: Kunibert connected to 9 app reposmre
  • c22aff69log: PR-only rollout startedmre
  • 25309981log: STOP and paused workers 2026-11-08mre
  • 5286803alog: worker briefs and reports of 2026-11-08mre
  • 85c86605log: 2026-11-08 Arachne on list shapemre
  • cb634512log: 2026-11-08 keyed lists livemre
  • 07c98d4aLists: keyed rows with @id, remove(id) and one whole-list assignment instead of hand-rebuilt loopsmre
  • 0db0d81elog: 2026-11-08 day52 live, W30 startedmre
  • b05f6d92tests/status: the gate's 3 s app token expired during the restart; it lives 60 s like status-keyedmre
  • 1e8f4f0avendor: Hybriel set-day52 (fault-path leak fix #335, keyed rows #331)mre
  • f5f0fb7blog: 2026-11-08 day50/#29 live, H25 correction, V52 startedmre
  • dc77fb95main: offline note from __hlOnline, tick removed (#29)mre
  • 37a86d93tests/reviews: seeded fake hook's DNS failures are not server errors (flaky gate)mre
  • 07ab845bvendor: Hybriel set-day50 (run() leak fix #335)mre
  • 71b2fa4blog: hybriel#335mre
  • bd94cc7elog: #25 cause found (run() leak)mre
  • 565cb508log: H25 round 1mre