Re: Sample pre-push hook can crash

2016-03-11 Thread Stephen Morton
Thanks for the information Junio. It is just interesting that although the pre-push hook receives the remote_sha value from the server, it does not get 'git merge-base $remote_sha $local_sha' which is what a check that iterated over all outgoing commits would really need. (I'm sure this is a

Re: Sample pre-push hook can crash

2016-03-11 Thread Junio C Hamano
Stephen Morton writes: > That is interesting, so in the case of a non-ff push, there is no way > for a pre-push hook to know what is being pushed in order to run? If you were up-to-date from the other side once: ---A---B---C and built one new commit on top:

Re: Sample pre-push hook can crash

2016-03-11 Thread Stephen Morton
That is interesting, so in the case of a non-ff push, there is no way for a pre-push hook to know what is being pushed in order to run? Steve On Thu, Mar 10, 2016 at 4:43 PM, Junio C Hamano wrote: > Stephen Morton writes: > >> The sample pre-push

Re: Sample pre-push hook can crash

2016-03-10 Thread Junio C Hamano
Stephen Morton writes: > The sample pre-push hook provided with git [1] will crash if the local > repo is not up to date with the remote as $remote_sha is not present > in the local repo. I'm not sure if this patch is exactly correct, it's > just provided as an

Sample pre-push hook can crash

2016-03-10 Thread Stephen Morton
The sample pre-push hook provided with git [1] will crash if the local repo is not up to date with the remote as $remote_sha is not present in the local repo. I'm not sure if this patch is exactly correct, it's just provided as an example. Given that people are likely crafting their own solutions