File tree Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Original file line number Diff line number Diff line change
1
+ To activate:
2
+
3
+ $ git config core.hooksPath .githooks
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Hash using its key as a search Regex, and its value as associated
4
+ # error message.
5
+
6
+ declare -A PATTERNS;
7
+ PATTERNS[' src/external/rawspeed' ]=" use --no-verify to change rawspeed" ;
8
+
9
+ # Loop over staged files and check for any specific pattern listed in
10
+ # PATTERNS keys.
11
+ # Filter only added (A), copied (C), modified (M) files
12
+
13
+ declare -a errors
14
+
15
+ for file in $( git diff --staged --name-only --diff-filter=ACM --no-color) ; do
16
+ for elem in ${! PATTERNS[*]} ; do
17
+ if [ ! -z " ${PATTERNS[${file}]} " ]; then
18
+ errors+=(" ${PATTERNS[${file}]} " )
19
+ fi
20
+ done
21
+ done
22
+
23
+ # Print errors
24
+ for error in " ${errors[@]} " ; do
25
+ echo -e " \033[1;31m${error} \033[0m"
26
+ done
27
+
28
+ # If there is any error, then stop commit creation
29
+ if ! [ ${# errors[@]} -eq 0 ]; then
30
+ exit 1
31
+ fi
Original file line number Diff line number Diff line change 2
2
path = src/external/rawspeed
3
3
url = https://github.com/darktable-org/rawspeed.git
4
4
branch = develop
5
- ignore = all
Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
5
+ # setup local hooks
6
+ git config core.hooksPath .githooks
7
+
5
8
DT_SRC_DIR=$( dirname " $0 " )
6
9
DT_SRC_DIR=$( cd " $DT_SRC_DIR " && pwd -P)
7
10
327
330
328
331
# install the binaries
329
332
eval " $cmd_install "
330
-
You can’t perform that action at this time.
0 commit comments