summaryrefslogtreecommitdiffstats
path: root/generate-hooklist.sh
blob: 2f9f54eb545be2bd79c37a868dbeef96d2ddfb9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
#
# Usage: ./generate-hooklist.sh >hook-list.h

cat <<EOF
/* Automatically generated by generate-hooklist.sh */

static const char *hook_name_list[] = {
EOF

sed -n \
	-e '/^~~~~*$/ {x; s/^.*$/	"&",/; p;}' \
	-e 'x' \
	<Documentation/githooks.txt |
	LC_ALL=C sort

cat <<EOF
	NULL,
};
EOF