Append ticket number using git commit hooks?

You missed a hook. The one you want is commit-msg: This hook is invoked by git commit, and can be bypassed with –no-verify option. It takes a single parameter, the name of the file that holds the proposed commit log message. Exiting with non-zero status causes the git commit to abort. So for example: #!/bin/sh … Read more

Chaining git hooks

After further investigation and testing, here is a working solution: create file .git/hooks/hook-chain as follows #!/bin/bash # # author: orefalo hookname=`basename $0` FILE=`mktemp` trap ‘rm -f $FILE’ EXIT cat – > $FILE for hook in $GIT_DIR/hooks/$hookname.* do if test -x “$hook”; then # echo $hook cat $FILE | $hook “$@” status=$? if test $status -ne … Read more

git commit in pre-push hook

You can’t: the push command figures out which commits to push before invoking the hook, and pushes that if the hook exits 0. I see three options: Exit nonzero, telling the user “push rejected because I added a commit” Exit zero, telling the user “push went through but you’ll need to push again because I … Read more

How do I react to new tags in git hooks?

Tags are refs like any other (like commit). If tags are pushed to a repo with a post-receive hook, that hook will be called and will list all updated refs, that is both old and new values of all the refs in addition to their names (on its standard input). See this server post-receive email … Read more

How to set up a Git hook so that after pushing to ssh://peter@foo.com/~/bar.com.git, it will go to ~/bar.com and do a git pull?

You can add a post-receive hook to the ~/bar.com.git repo for this. To do this add to the ~/bar.com.git/hooks/ directory an executable file post-receive with the content: #!/bin/sh unset $(git rev-parse –local-env-vars) cd ~/bar.com git pull Make sure the post-receive file has the executable bits(e.g. 755). Now whenever something is pushed to the ~/bar.com.git repo, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)