Re: [git-users] post-merge hook not working

2014-12-15 Thread Dharshan Bharathur
Previously i was tried to check local head with the remote head after
merging. That means 'no output' because after merging both will be same.
So to show which are all the commits pulled in the recent i modified like
this
`git log ORIG_HEAD..origin/master --pretty=format:"%s - %ar by %an %h"`

Which checks with the previous head and returns me pulled commits.



*Thanks & RegardsDharshan*

On Mon, Dec 15, 2014 at 6:40 PM, Konstantin Khomoutov <
flatw...@users.sourceforge.net> wrote:
>
> On Thu, 11 Dec 2014 02:29:27 -0800 (PST)
> Dharshan Bharathur  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 git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] post-merge hook not working

2014-12-15 Thread Konstantin Khomoutov
On Thu, 11 Dec 2014 02:29:27 -0800 (PST)
Dharshan Bharathur  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 git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] post-merge hook not working

2014-12-11 Thread Dharshan Bharathur
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.?



-- 
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.