From: Felipe Contreras Date: Wed, 23 Apr 2014 09:07:37 GMT Subject: Re: [RTC/PATCH] Add 'update-branch' hook Message-ID: <535782d95bbed_24448772ec7a@nysa.notmuch> In-Reply-To: <85mwfc4hab.fsf@stephe-leake.org> Stephen Leake wrote: > Felipe Contreras writes: > > > Stephen Leake wrote: > >> Felipe Contreras writes: > >> > >> > Ilya Bobyr wrote: > >> >> On 4/21/2014 2:17 PM, Felipe Contreras wrote: > >> >> > Ilya Bobyr wrote: > >> >> > > >> >> >> Also, most have names that start with either "pre-" or "post-". > >> >> >> It seems reasonable for both "pre-update-branch" and > >> >> >> "post-update-branch" to exist. > >> >> > I don't see what would be the point in that. > >> >> > >> >> Do you see the point in the other hooks doing that? > >> > > >> > Yes, there a reason for the existance of those hooks. Now tell me why would > >> > anybody use post-update-branch instead of pre-update-branch? > >> > >> I have a branch which should always be recompiled on update; > >> post-update-branch would be a good place for that. > > > > And why would pre-update-branch not serve that purpose? > > Because the code that needs to be compiled is not yet in the workspace And it won't be in 'post-update-branch' either. % git checkout master % git branch feature-a stable <- update-branch hook will be called here The hook will get 'feature-a' as the first argument, but the code in the workspace would correspond to 'master'; the checked out branch (pre or post). -- Felipe Contreras