You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

11 lines
394 B

  1. #!/bin/sh
  2. cd "$(dirname "$0")"
  3. CLANG_FORMAT="$(find $(echo "$PATH" | tr ':' ' ') -name 'git-clang-format-*' | sort | tail -n1 )"
  4. if [ -z "$CLANG_FORMAT" ]; then
  5. echo >&2 'Could not find a clang-format to use. Is the package clang-format installed?'
  6. exit 1
  7. fi
  8. git "$(basename "$CLANG_FORMAT" | cut -d'-' -f 2-)" --diff "$@" | \
  9. sed "s#+/\*\}\}\}\*/#+ /*}}}*/#" | \
  10. patch -p1