| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
#************************************************************************** |
| 4 |
#* * |
| 5 |
#* OCaml * |
| 6 |
#* * |
| 7 |
#* Gabriel Scherer, projet Parsifal, INRIA Saclay * |
| 8 |
#* * |
| 9 |
#* Copyright 2018 Institut National de Recherche en Informatique et * |
| 10 |
#* en Automatique. * |
| 11 |
#* * |
| 12 |
#* All rights reserved. This file is distributed under the terms of * |
| 13 |
#* the GNU Lesser General Public License version 2.1, with the * |
| 14 |
#* special exception on linking described in the file LICENSE. * |
| 15 |
#* * |
| 16 |
#************************************************************************** |
| 17 |
|
| 18 |
# Run check-typo, comparing only files that have changed since a particular |
| 19 |
# git state |
| 20 |
|
| 21 |
check_typo_since() { |
| 22 |
CHECK_TYPO=$(dirname $0)/check-typo |
| 23 |
git -c core.quotePath=false diff --name-only $1 \ |
| 24 |
| (while IFS= read -r path |
| 25 |
do |
| 26 |
if test -e "$path"; then :; else continue; fi |
| 27 |
$CHECK_TYPO --check-prune "$path" 2>/dev/null |
| 28 |
if test $? -eq 0; then continue; fi |
| 29 |
$CHECK_TYPO "$path" |
| 30 |
done) |
| 31 |
} |
| 32 |
|
| 33 |
case $# in |
| 34 |
0) echo "usage: check-typo-since <git reference>"; exit 2;; |
| 35 |
1) check_typo_since $1;; |
| 36 |
*) echo "too many arguments"; exit 2;; |
| 37 |
esac |