forked from soc-dv/chipyard
-
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.
- Loading branch information
1 parent
c63fbfa
commit fc380b2
Showing
3 changed files
with
37 additions
and
0 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 @@ | ||
docs/* |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ ! -a .ciignore ]]; then | ||
exit # If .ciignore doesn't exists, just quit this Git hook | ||
fi | ||
|
||
# Load in every file that will be changed via this commit into an array | ||
changes=( `git diff --name-only --cached` ) | ||
|
||
# Load the patterns we want to skip into an array | ||
mapfile -t blacklist < .ciignore | ||
|
||
for i in "${blacklist[@]}" | ||
do | ||
# Remove the current pattern from the list of changes | ||
changes=( ${changes[@]/$i/} ) | ||
|
||
if [[ ${#changes[@]} -eq 0 ]]; then | ||
# If we've exhausted the list of changes before we've finished going | ||
# through patterns, that's okay, just quit the loop | ||
break | ||
fi | ||
done | ||
|
||
if [[ ${#changes[@]} -gt 0 ]]; then | ||
# If there's still changes left, then we have stuff to build, leave the commit alone. | ||
exit | ||
fi | ||
|
||
# Prefix the commit message with "[skip ci]" | ||
sed -i '1s/^/[skip ci] /' "$1" |
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,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
# adds githooks, expects to be run from base directory | ||
|
||
git config core.hooksPath .githooks |