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:
8 # if [ -x .private/post-rewrite.sh ]; then
9 # source .private/post-rewrite.sh
12 # NOTE: These versioning hooks are intended to be used *INTERNALLY* by the
13 # libusbx development team and are NOT intended to solve versioning for any
14 # derivative branch, such as one you would create for private development.
19 # Check if a .amend exists. If none, create one and warn user to re-commit.
20 if [ -f .amend
]; then
23 echo "Amend commit detected, but no .amend file - One has now been created."
24 echo "Please re-commit as is (amend), so that the version number is correct."