Skip to content

Feature request: Cache lefthook run results to skip redundant executions #1366

@nurazon59

Description

@nurazon59

Thank you for this great product.

Description

Cache the result of each job in lefthook run and skip re-execution when the input is unchanged.

What problem it is solving?

There are cases where the same checks run twice against the same files:

  • Run lefthook run pre-commit beforehand to pass all checks, then commit → the pre-commit hook fires and runs the same checks again
  • Run lefthook run pre-push at commit time (via a custom hook), then push later → the pre-push hook fires and runs the same checks again

In both cases, if the input (file contents + command definition) hasn't changed, the result would be the same, so the re-execution could be skipped.

I'd be happy to contribute an implementation if this proposal is accepted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestA new lefthook feature description

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions