Benjamin Schachter
01/03/2024, 3:07 PMJacob Gold
01/23/2024, 3:45 AMBenjamin Schachter
01/23/2024, 1:39 PMand then added a .husky/prepare-commit-msg hook with the following:
#!/bin/bash
# We don't want to run commitizen when we are amending an existing commit,
# since it already has a commit message. We also don't want to run it when
# rebasing, since Graphite rebases under the hood often, and if there's an
# interactive step it will just freeze.
IS_AMEND_OR_REBASE=$(ps -ocommand= -p $PPID | grep -e '--amend' -e 'rebase');
if [ -n "$IS_AMEND_OR_REBASE" ]; then
exit 0;
fi
(exec < /dev/tty && npx cz --hook) || trueBenjamin Schachter
01/23/2024, 1:39 PM