File: pre-commit

package info (click to toggle)
i3blocks 1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 548 kB
  • sloc: ansic: 2,439; makefile: 30; javascript: 29; sh: 19
file content (26 lines) | stat: -rwxr-xr-x 454 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

set -e

pushd docs >/dev/null

if git diff --name-only --staged -- *.adoc | grep -q ^
then
  rake -v
  echo "Documentation was regenerated."

  if git diff --name-only -- *.adoc | grep -q ^
  then
    echo "Some documentation source files are unstaged,"
    echo "stage and commit hunks yourself with:"
    echo
    echo "    git commit --no-verify --patch *.1 *.html"
    echo

    exit 1
  fi

  git add -v -u *.1 *.html
fi

popd >/dev/null