Artifact 3a5031cc2f6956d829950b54fa7bf5d2fca9eea0b4c08db8973b42a494b68ff8:
- File
src/scan.h
— part of check-in
[d74c54957c]
at
2026-11-13 05:53:44
on branch trunk
— Phase 4b-1: suit finds your projects and gives each its key
suit roots names the folders to look in. suit projects scan walks them and lists each project with its key: the remote address reduced to host and path. suit project set gives a key by hand.
git: the key is read from the project's own config file, and a linked worktree gets its project's key. Fossil: read from the checkout's database through SQLite. zit: no key from a scan; one is set by hand. The scan runs no other program, follows no symlink, and does not look inside a project for more projects.
A user name or password in a remote address never reaches suit's files or output; a test checks it.
Nothing is placed in a project yet. That is the next piece.
993 unit checks, 227 shell cases, 146 store cases, 612 placement cases and 118 project cases, under clang and under gcc 16. 100% coverage in all 18 source files. A fourth fuzz target covers the new file formats, with 297 inputs checked in. (user: dmestas, size: 551) [annotate] [blame] [check-ins using]
#ifndef SUIT_SCAN_H #define SUIT_SCAN_H #include "project.h" // Find the projects under ROOTS and match each to its remote key (docs/projects.md). // OUT is emptied first and gets one entry per project folder and per worktree. // SET's keys, by path, replace what the scan reads. A folder suit cannot read is // skipped with a note on stderr. Returns 0, or 1 after saying why OUT filled up. int scan_projects(const Roots *roots, const Projects *set, Projects *out); constexpr int SCAN_DEPTH = 4; // folders below a root that are looked in #endif