xref: /dragonfly/tools/commit-msg (revision 3ea159d2)
1dae31c50SAlex Hornung#!/bin/sh
2dae31c50SAlex Hornung#
3dae31c50SAlex Hornung# This commit-msg hook tries to guess whether the current commit addresses
4dae31c50SAlex Hornung# an existing bug based on a number of keywords in the commit message and
5*3ea159d2SAaron LI# reminds the committer of backporting it.
6dae31c50SAlex Hornung
7*3ea159d2SAaron LIgrep -v '^#' "$1" |
8*3ea159d2SAaron LI	grep -Eiq 'CVE|vulnerability|fix|panic|bug|Reported-by|Dragonfly-bug'
9*3ea159d2SAaron LIif [ $? -eq 0 ]; then
10dae31c50SAlex Hornung	echo ''
11*3ea159d2SAaron LI	echo 'NOTE: This commit seems to fix an existing issue;' \
12*3ea159d2SAaron LI	     'please consider backporting it to the current stable release.'
13dae31c50SAlex Hornung	echo ''
14dae31c50SAlex Hornungfi
15*3ea159d2SAaron LI
16*3ea159d2SAaron LIexit 0
17