-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from tovrstra/fix_git_docs
Fix #61: Improved git install and config docs
- Loading branch information
Showing
4 changed files
with
45 additions
and
59 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
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
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
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,25 @@ | ||
#!/bin/bash | ||
|
||
red="\033[1;31m" | ||
color_end="\033[0m" | ||
|
||
# Check unwanted trailing whitespace or space/tab indents; | ||
if [[ `git diff --cached --check` ]]; then | ||
echo -e "${red}Commit failed: trailing whitespace, trailing empty lines, DOS/Windows line endings${color_end}" | ||
git diff --cached --check | ||
exit 1 | ||
fi | ||
|
||
# Check for untracked files (not in .gitignore) | ||
if [[ `git status -u data horton doc scripts tools -s | grep "^??"` ]]; then | ||
echo -e "${red}Commit failed: untracked files (not in .gitignore).${color_end}" | ||
git status -u data horton doc scripts tools -s | grep "^??" | ||
exit 1 | ||
fi | ||
|
||
# Check for new print statements | ||
if [[ `git diff --cached | grep '^+' | sed 's/^.//' | sed 's:#.*$::g' | grep 'print '` ]]; then | ||
echo -e "${red}Commit failed: print statements${color_end}" | ||
git diff --cached | grep '^+' | sed 's/^.//' | sed 's:#.*$::g' | grep print | ||
exit 1 | ||
fi |