pre-push hook should only look at staged changes
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
if i have modified the repository locally, but not committed those changes, and i run git push, i expect it to lint on the changes that are actually going to be pushed, not the ones i have laying around.
instead, src/etc/pre-push lints on the working directory.
it would be nice if it checked if there are unstaged changes, and if so copied the working directory to a tempdir to run the checks there. here is a hacky bash script that does it for checks that work file-at-a-time; i don't think tidy ever looks at multiple files at once or tries to build code, but if it does it would need more work.
Meta
HEAD is f989d2f62500df1696eb797d8800a705293b43b9
@rustbot label +A-bootstrap +A-contributor-roadblock +E-medium
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading src/etc/pre-push and the linked bash script to understand how the current checks inspect the working directory. Reproduce the case with unstaged changes, then verify that the hook checks only changes that would be pushed while preserving support for the existing checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, git, rust
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100