Enable linux netlink event monitoring for Android OS platform services
[libusb.git] / .private / post-rewrite.sh
blobd1f9999ad6e35dab8523d586da6f15160188398d
1 #!/bin/sh
3 # Detect amended commits and warn user if .amend is missing
5 # To have git run this script on commit, create a "post-rewrite" text file in
6 # .git/hooks/ with the following content:
7 # #!/bin/sh
8 # if [ -x .private/post-rewrite.sh ]; then
9 # . .private/post-rewrite.sh
10 # fi
12 # NOTE: These versioning hooks are intended to be used *INTERNALLY* by the
13 # libusb development team and are NOT intended to solve versioning for any
14 # derivative branch, such as one you would create for private development.
17 if [ -n "$LIBUSB_SKIP_NANO" ]; then
18 exit 0
21 case "$1" in
22 amend)
23 # Check if a .amend exists. If none, create one and warn user to re-commit.
24 if [ -f .amend ]; then
25 rm .amend
26 else
27 echo "Amend commit detected, but no .amend file - One has now been created."
28 echo "Please re-commit as is (amend), so that the version number is correct."
29 touch .amend
30 fi ;;
31 *) ;;
32 esac