Skip to content

Say the Pre-Commit Framework Sets Unstaged Changes Aside - #2922

Merged
ptr727 merged 1 commit into
developfrom
feature/pre-commit-sets-aside-wording
Oct 13, 2026
Merged

ptr727 merged 1 commit into
developfrom
feature/pre-commit-sets-aside-wording

Conversation

@ptr727

@ptr727 ptr727 commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Fixes #2912

Two lines described the pre-commit framework as one that "stashes" unstaged changes, which reads as a write to the shared git stash list beside the write-safety rule. Both now say the runner sets unstaged changes aside.

Source evidence, pre_commit/staged_files_only.py in the upstream pre-commit repository:

  • _unstaged_changes_cleared(patch_dir) writes the unstaged diff to a patch<time>-<pid> file under patch_dir (the framework's own cache directory) and reapplies it afterwards with _git_apply.
  • staged_files_only(patch_dir) wraps the hook run in that context manager.
  • The module never calls git stash and never touches refs/stash. Only its log message uses the word "Stashing".

Gates run locally: build_dist --check, repo_gate, prose_lint (default whole-tree set and diff-scoped), spec/validate, docker_lint. The opt-in sentence-length and sentence-split checks flag only sentences that were already on the two touched lines.

🤖 Generated with Claude Code

The write-safety law now tells a task to leave the shared git stash list alone. Two lines still said the pre-commit framework "stashes" unstaged changes, which beside that rule can read as the hook writing to refs/stash. The framework saves unstaged changes as a patch file in its own cache directory and reapplies it, so both lines now say it sets them aside.

Fixes #2912

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 13, 2026 00:04
@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5858f7a1-da13-4d37-a19b-209016a36997
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Documentation-only changes were fully reviewed with no unresolved issues.

0 open findings

What changed in this PR

Clarifies that pre-commit sets unstaged changes aside without using Git’s shared stash.

Changes:

  • Updated the governance hook description.
  • Updated the pre-commit snippet documentation.
File Description
GOVERNANCE.md Clarifies pre-commit behavior.
catalog/​snippets/​pre-commit/​README.md Aligns snippet documentation.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.00%. Comparing base (24d1df3) to head (2b4e477).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2922   +/-   ##
========================================
  Coverage    60.00%   60.00%           
========================================
  Files           17       17           
  Lines         8773     8773           
========================================
  Hits          5264     5264           
  Misses        3509     3509           
Flag Coverage Δ
python-3.13 60.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit c7723ab into develop Oct 13, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/pre-commit-sets-aside-wording branch October 13, 2026 00:11
ptr727 added a commit that referenced this pull request Oct 13, 2026
…ncurrency Exception to Main (#2924)

- #2922 says the `pre-commit` framework sets unstaged changes aside, in
GOVERNANCE.md and the pre-commit snippet README, rather than "stashes",
which collided with the shared-stash rule
- #2923 lets a hub-only file cite a hub `docs/` section by path while a
carried file cites only instruction-set sections, drops hub-doc
citations from the carried workflow snippets, adds Concurrency exception
(5) for the codegen snippet's fixed-branch group, and cuts the validate
action's restatement of "Verification Discipline" to a citation

Closes #2912
Closes #2916
Closes #2917
Closes #2915

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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