Skip to content

fix: reject mode-only changes instead of silently dropping them - #79

Merged
2 commits merged into
mainfrom
fix/reject-mode-only-changes
Sep 27, 2026
Merged

2 commits merged into
mainfrom
fix/reject-mode-only-changes

Conversation

@vitali87

Copy link
Copy Markdown
Owner

Problem

A mode-only change (chmod +x run.sh) shows up in the diff as

diff --git a/run.sh b/run.sh
old mode 100644
new mode 100755

with zero hunks. The planner has nothing to assign, validate_coverage passes (no hunks means no gap), and the mode change is absent from every sub-PR — the same silent-drop failure mode #61 fixed for binary files. (Pure renames used to hit this too; #49's --no-renames turns them into delete+add with hunks, so they are handled.)

Fix

validate_no_binary_files also rejects hunk-less entries with HUNKLESS_FILES_UNSUPPORTED: Diff contains files with no text hunks (mode-only or empty changes), which cannot be assigned to a sub-PR: run.sh. Commit them separately and re-run. Because it lives in the same check it is enforced everywhere #61 enforces it: split before planning, validate_plan, and execute on a saved plan.

Applying mode changes in the worktree is the real feature (read new mode from the header and chmod in the group's worktree); this PR makes the drop loud rather than silent.

Tests

Mode-only entry alongside a text file: the validator raises with the path; validate_plan rejects even when the text hunks are fully covered. 450 tests pass, ruff clean.

Stacked on #61 (fix/reject-binary-files).

@coderabbitai

coderabbitai Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 46 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: a9085040-58cc-4078-b1b9-75cb9c12e773

📥 Commits

Reviewing files that changed from the base of the PR and between 671a081 and 2bba5bd.

📒 Files selected for processing (3)
  • pr_split/exceptions.py
  • pr_split/planner/validator.py
  • tests/test_validator.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

A chmod-only change produces a diff entry with no hunks. Like binary
files, nothing in the plan can claim it, coverage validation passes,
and the mode change is missing from every sub-PR. Reject it up front
with the same kind of message as binary files.
@vitali87
vitali87 force-pushed the fix/reject-mode-only-changes branch from 0954845 to cd7ee80 Compare August 30, 2026 13:06
Base automatically changed from fix/reject-binary-files to main August 31, 2026 01:14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015rnEEjXWDBdePRhKMmZr1w
@vitali87 vitali87 closed this pull request by merging all changes into main in 8ca9e3b Sep 27, 2026
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.

2 participants