Builtin Library
README.md
zm.add
Stage paths for the next commit. Takes a single path or an array of paths and marks them ready to be committed, following git staging semantics: an array stages every row its paths select once, so several files of one asset stage that asset's family once. Passing . (or the -A / --all sentinels) stages every dirty path at once, the same shortcut the shell zm add builtin recognises. Staging is the step between editing the working copy and committing — a commit takes only what has been staged.
A scene is staged as its scene.json holds it. Pending live scene edits (entities spawned or changed through the ECS) stay pending: write them into the scene first with the sceneAuthoring toolbox (changes, then acceptChanges) or, in edit mode, layers.active:save(). When a stage leaves pending edits out, a notice names them and the calls that keep or drop them.
opts.renormalize = true first restates every folder asset at or beneath the named paths from the files beneath it, as git add --renormalize does. A folder whose stated version is not the folder hash of its files is staged at the hash its files hold; a folder that already states it is left out. A row with nothing beneath it keeps the checksum it holds. No file is edited. A commit records every folder of the world outside deps/ and libs/ at the hash of the files it holds whether or not the folder is staged, so renormalize is needed only to see such a folder in the working state before committing.