cli: support local review of root commits - #372
Conversation
Signed-off-by: OllieinCanada <73385593+OllieinCanada@users.noreply.github.com>
|
Hello,
would you mind elaborating on this? I am having a bit of trouble understanding the perceived usecase here |
|
Sure. The use case is a local repository where the requested review starts with the repository's initial (root) commit—for example, a small reproducer repository, a newly initialized repository, or imported history whose first commit also needs review. Today, when no baseline is supplied, sashiko-cli constructs ^ as the default baseline. A root commit has no parent, so Git cannot resolve that revision and the review exits before analyzing the commit. This PR handles only that boundary case by reviewing the root commit's tree directly. Commits that have a parent continue through the existing parent-baseline and patch-application path unchanged. The failure shown in #203 is consistent with this root-commit case, though confirmation from the reporter that the target SHA is the repository's root commit would remove the remaining uncertainty. |
Fixes #203
Summary
Allow
sashiko-cli localto 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
root..rootseries rangeValidation
cargo fmt --all -- --checkcargo clippy --all-targets --all-features --release -- -D warningsexcluded
No external Git server, AI provider, or paid API is required by the regression
tests.