forked from darktable-org/darktable
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dt git hook to avoid rawspeed change.
- Loading branch information
Showing
4 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
To activate: | ||
|
||
$ git config core.hooksPath .githooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# Hash using its key as a search Regex, and its value as associated | ||
# error message. | ||
|
||
declare -A PATTERNS; | ||
PATTERNS['src/external/rawspeed']="use --no-verify to change rawspeed"; | ||
|
||
# Loop over staged files and check for any specific pattern listed in | ||
# PATTERNS keys. | ||
# Filter only added (A), copied (C), modified (M) files | ||
|
||
declare -a errors | ||
|
||
for file in $(git diff --staged --name-only --diff-filter=ACM --no-color); do | ||
for elem in ${!PATTERNS[*]} ; do | ||
if [ ! -z "${PATTERNS[${file}]}" ]; then | ||
errors+=("${PATTERNS[${file}]}") | ||
fi | ||
done | ||
done | ||
|
||
# Print errors | ||
for error in "${errors[@]}"; do | ||
echo -e "\033[1;31m${error}\033[0m" | ||
done | ||
|
||
# If there is any error, then stop commit creation | ||
if ! [ ${#errors[@]} -eq 0 ]; then | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ | |
path = src/external/rawspeed | ||
url = https://github.com/darktable-org/rawspeed.git | ||
branch = develop | ||
ignore = all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters