On Thu, 11 Dec 2014 02:29:27 -0800 (PST) Dharshan Bharathur <[email protected]> wrote:
> Hi all, > > i enabled post-merge hook with following shell script > #/usr/bin/env bash > echo "======> following are changes made to local repo <======" > > git fetch && git log ..origin/master --pretty=format:"%s - %ar by %an > (%h)" > > echo "=======> ****************** <========" > > i have given needed permission also > chmod +x post-merge > > when i do > git pull origin master > > it prints me > echo "======> following are changes made to local repo <======" > echo "=======> ****************** <========" > > > But when i run the same > git fetch && git log ..origin/master --pretty=format:"%s - %ar by %an > (%h)" command it will return me exact result what i expect. > > > Does any one suggest me where i an going wrong.? Supposedly git, when run from your hook, sees different environment or working directory or whatever. Consider tracing what happens: in your script, before the line calling out to Git, put exec 2>&1 export GIT_TRACE=1 and then see what will be printed by the hook. -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
