Add some example hook scripts.
diff --git a/git-flow-feature b/git-flow-feature
index f362f08..3994729 100644
--- a/git-flow-feature
+++ b/git-flow-feature
@@ -211,11 +211,15 @@
require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
fi
+ run_pre_hook "$NAME" "$ORIGIN" "$BRANCH" "$BASE"
+
# create branch
if ! git checkout -b "$BRANCH" "$BASE"; then
die "Could not create feature branch '$BRANCH'"
fi
+ run_post_hook "$NAME" "$ORIGIN" "$BRANCH" "$BASE"
+
echo
echo "Summary of actions:"
echo "- A new branch '$BRANCH' was created, based on '$BASE'"
@@ -296,6 +300,8 @@
require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
fi
+ run_pre_hook "$NAME" "$ORIGIN" "$BRANCH"
+
# if the user wants to rebase, do that first
if flag rebase; then
if ! git flow feature rebase "$NAME" "$DEVELOP_BRANCH"; then
@@ -331,6 +337,8 @@
exit 1
fi
+ run_post_hook "$NAME" "$ORIGIN" "$BRANCH"
+
# when no merge conflict is detected, just clean up the feature branch
helper_finish_cleanup
}
@@ -377,6 +385,8 @@
git fetch -q "$ORIGIN"
require_branch_absent "$ORIGIN/$BRANCH"
+ run_pre_hook "$NAME" "$ORIGIN" "$BRANCH"
+
# create remote branch
git push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH"
git fetch -q "$ORIGIN"
@@ -386,6 +396,8 @@
git config "branch.$BRANCH.merge" "refs/heads/$BRANCH"
git checkout "$BRANCH"
+ run_post_hook "$NAME" "$ORIGIN" "$BRANCH"
+
echo
echo "Summary of actions:"
echo "- A new remote branch '$BRANCH' was created"
@@ -401,12 +413,17 @@
# sanity checks
require_clean_working_tree
require_branch_absent "$BRANCH"
+
+ run_pre_hook "$NAME" "$ORIGIN" "$BRANCH"
+
git fetch -q "$ORIGIN"
require_branch "$ORIGIN/$BRANCH"
# create tracking branch
git checkout -b "$BRANCH" "$ORIGIN/$BRANCH"
+ run_post_hook "$NAME" "$ORIGIN" "$BRANCH"
+
echo
echo "Summary of actions:"
echo "- A new remote tracking branch '$BRANCH' was created"