first sorry for my english :p

I try to deploy a web application when I push commit from my local to my 
bare repository. I use post-receive hook and want to create a file (not 
versionned) containing some revision informations.
For this purpose, I launch the following commands in my post-receive hook :

GIT_COMMAND="git --work-tree=${DEV_DEPLOYMENT_DIR} --git-dir=${GIT_DIR}"
$GIT_COMMAND checkout -f

TAG=`$GIT_COMMAND tag | tail -1`
HASH=`$GIT_COMMAND rev-parse --short HEAD`
COMMIT=`$GIT_COMMAND shortlog | grep -E '^[ ]+\w+' | wc -l`


var TAG is correctly set (*eg 3.0.0, 3.0.1 ...*)
var HASH is correctly set (*with last commit short hash*)
var COMMIT isn't correctly set (*I always have 0*)

After many searches, I don't understand why "shortlog" command doesn't work 
in my hook. I've tried to launch this command with my GIT user via SSH and 
I get the correct commit count. But in post-receive hook command always 
return 0.

Can someone explain this to me plz ?


You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to