action list: missing renames from previous name "group"
[lttng-tools.git] / extras / install-checkpatch-hook
1 #!/bin/sh
2 #
3 # Copyright (C) 2013 Christian Babeux <christian.babeux@efficios.com>
4 #
5 # SPDX-License-Identifier: GPL-2.0-only
6 #
7
8 # Install the checkpatch pre-commit hook.
9
10 DIR="$( cd "$( dirname "$0" )" && pwd )"
11
12 PRECOMMIT_HOOK="../.git/hooks/pre-commit"
13 PRECOMMIT_SCRIPT="checkpatch-hook"
14 CHECKPATCH_CONF=".checkpatch.conf"
15
16 if [ -f $PRECOMMIT_HOOK ];
17 then
18 echo "File $PRECOMMIT_HOOK already exists. Aborting."
19 exit 1
20 else
21 ln -s $DIR/$PRECOMMIT_SCRIPT $PRECOMMIT_HOOK
22 fi
23
24 if [ -f ../$CHECKPATCH_CONF ];
25 then
26 echo "File ../$CHECKPATCH_CONF already exists. Aborting."
27 exit 1
28 else
29 ln -s $DIR/$CHECKPATCH_CONF ../$CHECKPATCH_CONF
30 fi
31
32 echo "Checkpatch pre-commit hook successfully installed!"
This page took 0.053605 seconds and 4 git commands to generate.