0

I have a post-checkout hook that substitutes the new branch name into some skeleton files in the "main" branch of the repository. This seems to cause pre-commit to indicate failure when it does what I intend, though this is normally correct behavior. Is there an option I'm missing? Can I tell pre-commit that any file modification by this hook is acceptable?

I see "The hook must exit nonzero on failure or modify files" in the documentation, and my hook does exit with an exit code of 0.

sappjw
  • 373
  • 1
  • 14
  • there isn't an option for that -- modifying checked in files like that seems odd – anthony sottile Oct 08 '22 at 00:14
  • Thanks. I've chosen to use branches to separate my code and configuration for many projects while retaining a tight coupling between them. It's supposed to be a shadow of [cookiecutter](https://www.cookiecutter.io/), but multiple repos are overkill in this situation. Each branch is for a separate project and needs some template substitution before being used. – sappjw Oct 11 '22 at 12:55
  • that sounds like a bad solution to a problem that doesn't really exist – anthony sottile Oct 11 '22 at 13:11

0 Answers0