gitconfig.sh 404 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. #
  3. # This script configures a git repository to support pwman database diff-ing.
  4. #
  5. set -e
  6. if ! [ -d .git ]; then
  7. echo "ERROR: The current directory is not a git repository." >&2
  8. exit 1
  9. fi
  10. git config --replace-all diff.pwman.textconv "pwman -c \"dbdump -h\""
  11. if ! [ -e .gitattributes ] ||\
  12. ! grep -q 'diff=pwman' .gitattributes; then
  13. echo "*.db diff=pwman" >> .gitattributes
  14. fi
  15. exit 0