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