Skip to content
Permalink
Browse files

don't apply the spell check on all the file if no changes (#4031)

Before that:

$time git commit --amend 2> log
real    7m19.811s
user    49m14.012s
sys     0m16.668s

$ls -lh log
-rw-rw-r-- 1 sbrunner sbrunner 1,8M janv. 20 14:05 log
  • Loading branch information
sbrunner authored and 3nids committed Jan 20, 2017
1 parent f389cea commit 454383518a9ba241a999e37467846e046785139a
Showing with 6 additions and 1 deletion.
  1. +3 −1 scripts/prepare-commit.sh
  2. +3 −0 scripts/spell_check/check_spelling.sh
@@ -41,7 +41,9 @@ set -e

# determine changed files
MODIFIED=$(git status --porcelain| sed -ne "s/^ *[MA] *//p" | sort -u)
${TOPLEVEL}/scripts/spell_check/check_spelling.sh $MODIFIED
if [ "$MODIFIED" != "" ]; then
${TOPLEVEL}/scripts/spell_check/check_spelling.sh $MODIFIED
fi


if [ -z "$MODIFIED" ]; then
@@ -41,6 +41,9 @@ shift $(expr $OPTIND - 1)
if [ ! $# -eq 0 ]; then
EXCLUDE=$(cat $AGIGNORE | sed -e 's/\s*#.*$//' -e '/^\s*$/d' | tr '\n' '|' | sed -e 's/|$//')
INPUTFILES=$(echo $@ | tr -s '[[:blank:]]' '\n' | egrep -iv "$EXCLUDE" | tr '\n' ' ' )
if [ "$INPUTFILES" == "" ]; then
exit 0
fi
echo "Running spell check on files: $INPUTFILES"
else
INPUTFILES="."

0 comments on commit 4543835

Please sign in to comment.
You can’t perform that action at this time.