Skip to content

Add support for pre-commit hooks that have file changing side-effects #238

Open
@grempe

Description

@grempe

See the discussion in my unworkable pull-request for more details on the motivation for this request.

#235

Overcommit should allow pre-commit hooks to modify, add, or remove files in the working dir prior to a commit. Currently this is not possible and any changes made within the hook code will be silently wiped.

Native git hooks of course can do this so this is in some way a reduction in capability from native hooks.

For example, if a pre-commit hook wanted to automatically update a file with a version number or timestamp in it, this would not be possible since the modification to the file, even if added to the git index during the hook execution, would be removed with a git reset --hard after the pre-commit hooks finish running.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions