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
Latest commits
- 220f6342W60: record corrected form proof, full AE and remaining gapsmre
- 7e31cac5gitoria#28: restrict reply form layout to reply formsmre
- ae373cfdgitoria#28: keep each reply draft in its thread componentmre
- eeeebd5agitoria: insert a newly created organization oncemre
- 34d2d5cagitoria: clear the bound public-key textarea after creationmre
- 119e54c0W60: restore conductor-owned tracking filesmre
- 24b479e7W60: record final gates, Chrome failures and AE evidencemre
- 5e11184cW60: record partial validation, framework gaps and cleanupmre
- 20fe13fagitoria#33: centralize login and tickets connection statemre
- 859754c0gitoria#29: retain the offline note and record the framework gapmre
- d140bc04gitoria#30: reproduce the upsert ordering constraintmre
- 6960e8f8gitoria#28: keep form values in bound component membersmre
- 0db27200gitoria#32: share character checks and environment lookupmre
- 452f6a1amission W60: logic clean-upsmre
- 1448c899log: cleanup, #49 GPTBot, tracker mentions on #36mre
- fcf95936log: v1.5.1 provenmre
- 22105420log: W51b livemre
- 7e8aabeareport: W51b pull source verificationmre
- 6c18de76fix: preserve pull sources across containing branchesmre
- fc36fa2elog: W51b pull source bugmre