Skip to content

cli: support local review of root commits - #372

Draft
OllieinCanada wants to merge 1 commit into
sashiko-dev:mainfrom
OllieinCanada:fix/203-root-commit-local-review
Draft

cli: support local review of root commits#372
OllieinCanada wants to merge 1 commit into
sashiko-dev:mainfrom
OllieinCanada:fix/203-root-commit-local-review

Conversation

@OllieinCanada

Copy link
Copy Markdown
Contributor

Fixes #203

Summary

Allow sashiko-cli local to review a repository's root commit.

Root commits are checked out and reviewed directly because they have no parent
baseline. Ordinary commits continue through the existing parent-based patch
application path.

Root cause

The local CLI always constructed <first commit>^ when no baseline was given.
That revision is invalid when the requested commit is the repository's first
commit, so the review subprocess exited before producing a result.

Changes

  • inspect the first commit's parent list before selecting the default baseline
  • use the direct-commit path for a parentless root commit
  • preserve root-commit file discovery and commit-message context for review
  • avoid constructing an empty root..root series range
  • add end-to-end CLI coverage for root and ordinary commits

Validation

  • reproduced the failure with the real CLI and review subprocess
  • root-commit and ordinary-commit CLI regression tests pass
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features --release -- -D warnings
  • ordinary release suite passes with the unrelated issue tests: make bad-tag recovery test portable across Git versions #350 portability test
    excluded
  • DCO sign-off check passes

No external Git server, AI provider, or paid API is required by the regression
tests.

Signed-off-by: OllieinCanada <73385593+OllieinCanada@users.noreply.github.com>
@derekbarbosa

Copy link
Copy Markdown
Collaborator

Hello,

Allow sashiko-cli local to review a repository's root commit.

Root commits are checked out and reviewed directly because they have no parent
baseline. Ordinary commits continue through the existing parent-based patch
application path.

would you mind elaborating on this? I am having a bit of trouble understanding the perceived usecase here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue reported by sashiko-cli when start review for local repo

2 participants