Skip to content

pre-push hook should only look at staged changes #125654

@jyn514

Description

@jyn514

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 f989d2f

@rustbot label +A-bootstrap +A-contributor-roadblock +E-medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustC-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions