Repository navigation
Conversation
Walks first-parent commits touching the fab pack and diffs each against its first parent via the shared git reader, board loader and compare path. Summary/Markdown/JSON output; pack added/removed reported; unparseable commits fail loud naming the commit; --max-commits caps the walk loudly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The review found an issue that should be addressed before approval.
2 open issues
What changed in this PR
Adds etchy log to inspect per-commit PCB layer changes over a Git range, reusing the existing board loader and diff engine without a checkout.
Changes:
- Adds first-parent history traversal with summary, Markdown, and JSON output.
- Introduces a commit cap, named commit errors, and pack addition/removal reporting.
- Adds CLI integration tests and documents the command.
| File | Description |
|---|---|
site/docs.html |
Documents history usage, output, and exit codes. |
README.md |
Adds a quick-start history example. |
docs/REQUIREMENTS.md |
Records the CLI-14 history contract. |
crates/etchy-core/src/report.rs |
Exposes the Markdown code-span helper. |
crates/etchy-cli/tests/log_cli.rs |
Tests history output, limits, and error handling. |
crates/etchy-cli/src/main.rs |
Dispatches log and extracts shared helpers. |
crates/etchy-cli/src/log.rs |
Implements history traversal, comparison, and formatting. |
CHANGELOG.md |
Announces the new history command. |
Review effort: Balanced
Comment on lines
+201
to
+205
| let pack = match (&old, &new) { | ||
| (None, Some(_)) => PackChange::Added, | ||
| (Some(_), None) => PackChange::Removed, | ||
| _ => PackChange::Present, | ||
| }; |
| let old = old.unwrap_or_else(|| empty.clone()); | ||
| let new = new.unwrap_or(empty); | ||
|
|
||
| let diff = compare_detailed(&old.0, &new.0).context("comparing with the first parent")?; |
This branch has not been deployed
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.

Fixes #424. Part of #418.
What
etchy log <RANGE> [SUBDIR] [--format summary|md|json] [--max-commits N]walksgit rev-list --first-parent <RANGE> -- <SUBDIR>and diffs each commit against its first parent, printing per commit which layers changed with added/removed mm² and region counts.Design calls (user unavailable — documented here)
load_board_git(git blob reader → sharedBoardBuilderloader, One board loader for CLI and viewer #464) →compare_detailed; the warning assembly was extracted intoreport_with_load_warningsand the non-UTF-8[SUBDIR]check (cli: non-UTF-8 filenames collapse to an empty label and classify as Other #299) intogit_subdir, both shared withrun. No checkout. etchy-core untouched apart from makingreport::md_code_spanpublic (used to keep commit subjects inert in Markdown, report: warnings embed raw filenames unescaped in the Markdown posted as a PR comment #298).git show -s --format=%P(real parents, not pathspec-simplified ones).pack: added/removed(diff vs an empty board → every layeradded-layer/removed-layer), never skipped.commit <sha12>: …).log(kept localised; layer change =report.any_changes()), so drill-count-only changes follow whatever Count a drill-table hole count change as a diff (#456) #476 decides for the two-ref mode later.--max-commitsdefault 200; rev-list asks for N+1 and more than N is an error, never truncation.git log; internally walked oldest-first so a parent's board is reused from a one-entry cache keyed by thels-treelisting (blob ids).logis intercepted before the two-revision parser (which takes bare positional paths). A directory literally namedlogmust be written./log; a stderr note says so when./logexists. Top-level--helpmentions the subcommand.<RANGE>starting with-is refused (never reaches git as an option).Tests
crates/etchy-cli/tests/log_cli.rsbuilds a temp repo from the demo pack: pack added (root), notes-only (unchanged), README outside the pack (not listed), rev B (changed), top silk removed, pack removed; plus cap, empty range, bad range, option-like range, and an unparseable commit. fmt, clippy-D warnings(with and withoutpdf), andcargo test -p etchy-clipass.Docs
README, site/docs.html, REQUIREMENTS CLI-14, CHANGELOG [Unreleased].