Expand description
.semora: marks a folder as a Semora project, and where a push came from.
The file is TOML meant to be committed:
server = "3f9c0e7a5b1d4e2f8a6c9b0d1e2f3a4b"
project = "semora"server is the id the server gave itself, so the file does not say where the server is.
It is only compared with the id of the configured server, never used to reach one: a cloned
repository must not be able to send your API key to another host. A file from before ids
holds the server’s URL; one for the configured server is moved to the id on first use.
Structs§
- File
Link - A
.semoraas it is written, before the CLI has asked its server whether the file is for it. - Link
- A
.semorathat is for the server this command uses. - Mapped
- The record a link is used through, and the config folder that holds it.
- Other
Server - A
.semoranames another server than the one this command uses. Commands add their own way out (push:--idor--new).
Enums§
- Fit
- How a
.semorarelates to the server this command uses. - Server
Ref - What a
.semoranames its server by.
Constants§
Functions§
- adopt
- The project has the id
slugon the server now. Rewrites.semora(or, for a link used through a record on this machine, the record) and the checkout record to it and says so. Any other answer leaves the link as it is. - find
- Looks for
.semorain the path’s folder and each parent. The nearest file wins. The current directory plays no part.Errmeans a file was found but is unusable. - fit
- How
filerelates to the serverclientuses. An id that differs from the cached one is checked once more with the server, in case the address now leads to another server. A file for another server may still be used here through a record on this machine. - follow
- The project as the server knows it now. An owner can give a project a new id; while the old one is an alias the server answers it with the new one. When the old id is gone, a document this folder pulled or pushed still says which project it is in. Errors other than a missing project are left for the command itself to report.
- git_
branch - The branch of the git checkout the path is in, read from
HEAD(nogitprocess). A worktree’s.gitis a file that names its git folder; a relative name is relative to the folder that holds that file. The walk starts fromstd::path::absolute, notcanonicalize: on Windows a canonical path is a\\?\path, and those do not resolve..or/, so the relative name is joined and cleaned up lexically instead. - origin_
for - Where a push came from:
machine · branch, or just the machine. - read_at
- The
.semoraindiritself, if there is one. - resolve
fileas a link for the serverclientuses, or the error that says why it is not and what to do. Nothing is sent for the project before this answers.- server_
value - The
servervalue of a file as local records key it. - set_
line - Sets the
keyline (projectorserver) ofdir/.semoratovalue, keeping every other line as it is. - shown
- A path for messages: without the
\\?\prefix thatcanonicalizeadds on Windows. - slug_
from - A project id from a directory name: lowercase it, turn every run of other characters into
one
-, trim-from both ends, cut to 40 characters, trim again. - valid_
slug [a-z0-9-], 1 to 40 characters, not starting with a dash.- write
- Writes
dir/.semoranaming the server by its id. Returns its path.