gitoria
All repositories: gitoria
1.9 KB
// lib/pullsync-helpers.hl — what lib/pullsync.hl looks up: the body of a commit message, the ticket names a text mentions,// one first line of git's answer. Statics only; git is not called here except through the `lines` handed in.import { NL } from './util.hl'// the commit message's lines → the text after the subject, without the blank line that separates them ('' if none)static bodyOfLines = (lines) => {let i = 1while (i < lines.length && lines[i].trim() == '') { i = i + 1 }out = []while (i < lines.length) {out.push(lines[i])i = i + 1}return out.join(NL).trimEnd()}static nameCode = (c) => {return (c >= 48 && c <= 57) || (c >= 65 && c <= 90) || (c >= 97 && c <= 122) || c == 45 || c == 46 || c == 95}static digitCode = (c) => { return c >= 48 && c <= 57 }// the tickets a text names, as `project#n` (contract §4): an explicit `project#12` is always listed; a bare `#12` only// when the repo is connected to a project (`project` is '' otherwise). No doubles, at most 50.static ticketNames = (text, project) => {out = []if (text == null || hlTypeName(text) != 'String') { return out }let i = 0while (i < text.length && out.length < 50) {if (text[i] == '#') {let j = i + 1while (j < text.length && j - i - 1 < 9 && digitCode(text.charCodeAt(j))) { j = j + 1 }let k = iwhile (k > 0 && nameCode(text.charCodeAt(k - 1))) { k = k - 1 }digits = text.slice(i + 1, j)// a full stop that ends a sentence ("Fixes proj#7.") does not belong to the number; one inside a name ("x.org") continues itafter = j >= text.length || !nameCode(text.charCodeAt(j)) || (text.charCodeAt(j) == 46 && (j + 1 >= text.length || !nameCode(text.charCodeAt(j + 1))))if (j > i + 1 && after && digits.slice(0, 1) != '0') {name = k < i ? text.slice(k, i) : projectif (name != null && name != '' && !out.includes(name + '#' + digits)) { out.push(name + '#' + digits) }}i = j > i + 1 ? j : i + 1} else {i = i + 1}}return out}
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
- 4a3f557eImport layouts theme ebd00b6 for W61 (startup blocked)mre
- 53ca42b2log: W60 merged, W61 W62 startedmre
- 80870a33mission W61: style passmre
- 560fd208Merge W60: helpers, bound forms, login in topics, two form fixes (gitoria#28 #32 #33)mre
- ac5ba6a4log: W60, #25 measuredmre
- 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