Skip to content

Instantly share code, notes, and snippets.

@MBoldyrev
MBoldyrev / pre-commit
Last active February 4, 2020 09:49
git hook to check c++ formatting
#!/bin/bash
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
prompt_confirm() {
while true; do
read -r -n 1 -p "${1:-Continue?} [y/n]: " REPLY