gitoria
All repositories: gitoria
3.2 KB
// components/addcode.hl — "ADD CODE TO THIS REPOSITORY" (gitoria#7, gitoria#20): the clone address and the exact git commands, for a// new folder and for an existing one; plain text on the Code tab (code, branch, commit pages) while nothing is pushed yet. The// password is an access token (main page). Shown only for an EXISTING, EMPTY repo; never on Readme / Pull requests / Releases /// 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// every navigation.import { NL, publicUrl, hostOnly, cloneOrigin } from '../lib/util.hl'import { slugOfRequest } from '../lib/orgs.hl'import { repoAt } from '../lib/repos.hl'import { isEmptyNow } from '../lib/git.hl'import { sshEnabled, sshUrl } from '../lib/sshkeys.hl'host = nullorepo = ''session = nullslug = slugOfRequest(host, orepo)repo = repoAt(slug, session)cloneUrl = repo != null ? cloneOrigin(slug) : ''tokensHref = publicUrl + '/#tokens'sshKeysHref = publicUrl + '/#sshkeys'showAddCode = repo != null && isEmptyNow(slug)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'existingCommands = 'git remote add origin ' + cloneUrl + NL + 'git branch -M main' + NL + 'git push -u origin main'cloneCommand = 'git clone ' + cloneUrl// SSH (only when the sshd container is set up, sshkeys.hl): the same commands with the ssh address; the key comes from the main pageshowSsh = sshEnabled && repo != nullsshAddress = repo != null ? sshUrl(hostOnly, repo.slug) : ''sshCloneCommand = 'git clone ' + sshAddresssshCommands = 'git remote add origin ' + sshAddress + NL + 'git push -u origin main'View {if (showAddCode) {addCode { id = "addcode"h2 { "Add code to this repository" }h2 { "Clone it" }pre { id = "clonecommand" cloneCommand }h2 { "Push a new project" }pre { id = "newcommands" newCommands }h2 { "Push an existing project" }pre { id = "existingcommands" existingCommands }if (showSsh) {h2 { "Or over SSH" }pre { id = "sshclonecommand" sshCloneCommand }pre { id = "sshcommands" sshCommands }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." }}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." }}}}Style {addCode {display = 'grid'gap = '.5rem'minWidth = '0''> *' {margin = '0'}}#addcode {padding = '1rem'background = 'var(--color-surface)'borderRadius = 'var(--radius-large)'pre {margin = '0'padding = '.6rem .8rem'overflowX = 'auto'font = '.875rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'color = 'var(--color-text-strong)'background = 'var(--color-background-sunken)'borderRadius = 'var(--radius-large)'whiteSpace = 'pre-wrap'overflowWrap = 'anywhere'}}}
Branches
- f1-broken-json
- f2-api-bugs
- gp-gate-ports
- heap-revert
- hl25-records
- ident-chooser-selector
- mainmain branch
- p51-public-pr-reads
- records-1112
- s25-no-session-on-login-error
- v59
- w52-person-approval
- w52b-approval-followup
- w52c-header-phone
- w53-pulls-speed-pr
- w54-repo-rename-pr
- w55-rename-org
- w56-owner-members
- w62-pr-close
- w63-force-push
- w64-org-slash
Latest commits
- 9f502db1gitoria#46: W46b briefmre
- 9678a8f3gitoria#46: contract v1.4, statuses keyed by app + contextmre
- bdcbbaa9gitoria#47: rate limits, status read route, statuses + required on the pull (merge w47-limits)mre
- 772c401fgitoria#45: W45 report, logmre
- b6b793afgitoria#45: PR page with reviews, threads, conversation, Review again (merge w45-pr-page)mre
- fb9e7554gitoria#45: browser gate: a /pulls title links to the PR pagemre
- f7198131gitoria#45: tests/pr-page.mjs gatemre
- 483141d0gitoria#45: Settings shows the Apps heading only to the ownermre
- e2eff8f6gitoria#45: the PR page /pulls/N with reviews, threads, verdicts, conversation, comment, reply, resolve and Review againmre
- 7a602839gitoria#45: raiseEvent can send to one app only; people's comments, replies and resolving in reviews.hlmre
- 5de7f578gitoria#47: rate limits per app (429, Retry-After), status read route, statuses and required on the pull, one JSON check for every write routemre
- 19edc1f5gitoria#44: contract v1.3.1, what outdated meansmre
- 7c2277ccgitoria#38: worker reports W40–W46, logmre
- 1c3fa842gitoria#45 #47: worker briefsmre
- 0a46bf7dgitoria#47: apps API contract v1.3 (status read route, statuses + required on the pull)mre
- 3373f7c3gitoria#38: push API contract v1.2.1, reviews, worker briefs and logmre
- 34143d2cgitoria#46: closing brace of appComments lost in the mergemre
- 54927c9cgitoria#46: PR statuses and required checks before merge (merge w46-status)mre
- 187e1871gitoria#46: badges without decorative bordersmre
- 6b022798gitoria#46: tests/status.mjs in GATESmre