Skip to content

Reject unknown commit IDs passed to --only - #192

Merged
connabyss merged 1 commit into
connabyss:mainfrom
The-Aizen-404:review/issue-178-unknown-commit-id
Nov 4, 2026
Merged

connabyss merged 1 commit into
connabyss:mainfrom
The-Aizen-404:review/issue-178-unknown-commit-id

Conversation

@The-Aizen-404

Copy link
Copy Markdown
Contributor

What was wrong, what changed, how checked:

Unknown IDs passed to --only were silently dropped, so --only zzzz reported “Nothing to check” and exited with code 0. The selected commits are now checked against the requested IDs before filtering for code changes. Missing IDs produce a clear error, a git log --oneline hint, and exit code 2. When several IDs are supplied, the error names only the missing ones. A valid commit that changed no code keeps the existing “Nothing to check” behavior.

The change adds regression coverage for a single unknown ID, mixed valid/missing IDs, and a valid empty commit. Only recent.py and tests/test_shard.py are changed.

Fixes #178

  • It links the issue it fixes.
  • For a bug fix: a test that fails without the change and passes with it.
  • python -m pytest passes (it runs tests/selftest.py too), and CI is green. The local full suite passes; CI is pending at submission.

Validation:

  • Before the source fix, the new unknown-ID regression failed because the command returned 0; the valid empty-commit preservation test passed.
  • On current upstream main (ec474f3): python -m pytest -n auto — 355 passed, 4 skipped (Linux, Python 3.12.3).
  • git diff --check — clean.

Assisted-by: Cue

Cue prepared the patch and performed the local validation reported above. The account owner authorized submission; no personal review or test execution by the account owner is claimed.

Return a clear error with exit code 2 for missing commit IDs, list only missing IDs, and preserve the no-code commit behavior. Add regression coverage.

Tests: python -m pytest -n auto — 355 passed, 4 skipped.

Assisted-by: Cue
@connabyss
connabyss merged commit 1a85373 into connabyss:main Nov 4, 2026
10 checks passed
@connabyss

Copy link
Copy Markdown
Owner

Thanks @phsecx! Clean fix, and the tests cover exactly the right cases. Merged.

@connabyss connabyss mentioned this pull request Nov 5, 2026
3 tasks done
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.

--only with a commit id that doesn't exist ends like nothing went wrong

2 participants