Repository navigation
Split comline clean into clean (code) + reset (history) - #15
Merged
Merged
Conversation
comline clean deleted .comline/ — the entire version history — with no confirmation and no way back, in the same gesture that removes regenerable generated code. Nothing else holds the history (no publish yet), so a build afterwards silently restarted at 0.0.1. - comline clean now removes only generated code; .comline/ is never touched. - comline reset (new) deletes .comline/ + generated code. On a TTY it prints how many versions will be lost and requires typing `reset`; without a TTY it refuses (exit 2) unless --force. --dry-run on either lists without deleting. - CliError::ConfirmationRequired -> exit 2. - clean.rs::generated_files is now pub(crate), shared with reset. - tests: clean.rs rewritten (code-only semantics); new reset.rs. - docs/cli.md + README updated; versioning-model section now states the history has no other copy and only reset discards it. All: cargo fmt --check, clippy -D warnings, 36 integration tests green.
Kinflou
pushed a commit
to ComlineProject/docs
that referenced
this pull request
Aug 30, 2026
ComlineProject/cli#15 merged. Updated reference/cli (clean row + new reset row + exit-2 note), reference/versioning (history model), guide/packages, guide/codegen/generating-code, and design/ir-generation (the section is now a record of what landed, retitled 'The clean / reset split').
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
comline cleanranremove_dir_all(".comline/")— the entire content-addressablestore, i.e. every frozen version and the commit chain — with no confirmation,
in the same command that removes regenerable generated code. There is no
publishyet, so
.comline/is the only copy of the history; abuildafterwards silentlyrestarts at
0.0.1.cleanin every comparable tool (cargo clean,make clean) means "removeregenerable output." This one also destroyed the irreplaceable part.
Change
comline clean [--dry-run]generateoutput root or files. Never touches.comline/.comline reset [--force] [--dry-run](new).comline/and generated code. On a TTY: prints how many versions will be lost, requires typingreset. Without a TTY: refuses with exit2unless--force.--dry-runlists (incl. the history that would be lost) and never prompts.CliError::ConfirmationRequired→ exit2(precondition), consistent with the existing contract.clean::generated_filesis nowpub(crate), shared by both.tests/cli/clean.rsrewritten for the code-only semantics; newtests/cli/reset.rs(force removes store + generated; no-TTY-no-force refuses and leaves.comline/; dry-run keeps everything).docs/cli.md+README.mdupdated; the versioning-model section now says the history has no other copy and onlyresetdiscards it.cargo fmt --check,cargo clippy --all-targets -- -D warnings, and all 36 integration tests pass locally.Note
comline cleanis kept (not removed) — it's the least-surprising home for"remove generated files," now matching what other toolchains mean by it.